People who code: we want your input. Take the Survey

You'd be better off adding or modifying the rewrite variable that's being passed to your register_taxonomy() call for the custom taxonomy. You can modify the rewrites to suit your purpose. For example: $taxonomy_args = array( // All the variables and their values... 'rewrite' => array( 'slug' => 'services/home-care', ), // ......


RewriteRule ^(.*)$$1 [R=301] You need to include the L flag on the RewriteRule directive, ie. [R=301,L] and ensure this rule is near the top of the .htaccess file, before the existing WordPress directives. Without the L flag, processing continues and the request is further rewritten (by the WordPress front-controller) before the ...


This one worked for me. function custom_rewrite_rules() { add_rewrite_rule('^services/(.*)/(.*)?', 'index.php?service_category=$matches[1]&tax_city=$matches[2]', 'top'); } add_action('init', 'custom_rewrite_rules');

Only top voted, non community-wiki answers of a minimum length are eligible