WordPress website giving 404

Please try this .htaccess. <IfModule mod_rewrite.c> RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /wordpress/index.php [L]

My website has some Crawling Errors?

This can be the case when you heave ‘deadlinks’ or broken links at one of your pages. You can try submitting a sitemap of your site. There are several plugins that can generate a sitemap for you. I can recommend Yoast SEO. Then just submit your sitemap URL at Google Webmaster tools. You can also … Read more

Custom Taxonomy Theme file not routing correctly

The template isn’t determined by the URL, it’s taxonom-{taxonomy_slug}.php See here for the full template hierarchy: https://developer.wordpress.org/themes/basics/template-hierarchy/ And a visual representation: https://wphierarchy.com/ Final Note on Terminology There’s a difference between taxonomies and terms, and muddling the two words or always referring to them as taxonomies will get confusing very quickly. For example ‘accounts’ would be … Read more

Unwanted URL with Custom Post Type

function rt_custom_post() { register_post_type( ‘book’, array( ‘labels’ => array( ‘name’ => __( ‘Books’ ), ‘singular_name’ => __( ‘Book’ ), ), ‘public’ => true, ‘has_archive’ => false, //this will eliminate the archive page ‘supports’ => array(‘title’,’editor’,’thumbnail’), ‘publicly_queryable’ => true ) ); if you add : ‘has_archive’ => false, to your register post type, it will remove … Read more

How to pass a more variable with page/subpage in Wordprees URL?

function add_custom_query_var( $vars ){ $vars[] = “q”; return $vars; } add_filter( ‘query_vars’, ‘add_custom_query_var’ ); mydomain/how-we-work/our-process/?q=more-value You can handle it with get_query_var( ‘q’ ); Edit1: If you want to use with ‘SEO URL’ you need to add_rewrite_rule function add_rewrites(){ add_rewrite_rule( ‘^how-we-work/our-process/([^/]*)/?’, ‘index.php?pagename=how-we-work/our-process&q=$matches[2]’, ‘top’ ); } add_action( ‘init’, ‘add_rewrites’ );

URLs fine in database but wrong in output

Ok, this was pretty strange. While only http// showed up in the URLs the database fields for the corrupted URLs were http://http// which obviously resulted in the error. I did another search & replace for those “double http” and that fixed it in the end. Still no idea why this only happened to some URLs … Read more