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