Override 404 page with htaccess

As far as I can see, it is not possible to use a custom 404 ErrorDocument directive in your htaccess file because WordPress’ index.php will always be found when processing the htaccess content. (unless ofcourse index.php got deleted for some reason) Because index.php is found, it will not trigger the ‘404 not found’ ErrorDocument directive. … Read more

Custom Post Type / Two level deep taxonomy (cat. and subcat.) uri problem (error 404)

After many headaches, I’ve spent days and hours finding a solution. I’ve find a solution for two problems commented above. I hope it helps to someone: PROBLEM 1: I realized that when I changed Permalink to Plain (wordpress admin > settings > permalink > Plain) and when I click in Breadcrumb link “iluminacion interior” it … Read more

Custom Permalink

The custom rule you are trying doesn’t meet the criteria. Here’s a nifty online .htaccess tester tool to see to check rewrite logic. Use the follow RewriteRule instead: RewriteCond %{QUERY_STRING} (^|&)name=(.*) RewriteRule ^(.*)$ /profile/%2/? [R=301,L] Be sure to replace ^example\.com$ on the first line with your actual domain. You can also embed it in the … Read more

Custom URL going to 404

Redirect early First of all, your redirect function should be hooked early: you are not relying on query variables there, so you could use init hook: function search_redirect() { if (!empty($_GET[‘s’])) { $home = trailingslashit(home_url(‘catalog-of-work’)); wp_safe_redirect($home.urlencode(get_query_var(‘s’))); exit(); } } add_action(‘init’, ‘search_redirect’); The reason is that this will redirect the request much earlier, saving a lot … Read more