how to use mutliple add_rewrite_rule?

This is a follow up from the question How to attach region identifier to a pretty url? I want to apply this add_rewrite_url to multiple pages? I tried adding a 2nd add_rewrite_rule as follows: add_action(‘init’, ‘country_selection_url’); function country_selection_url() { add_rewrite_rule(‘^teacher/([^/]*)/’,’index.php?pagename=teacher&country=$matches[1]’,’top’); add_rewrite_rule(‘^parent/([^/]*)/’,’index.php?pagename=parent&country=$matches[1]’,’top’); } add_filter(‘query_vars’,’country_selection’); function country_selection($query_vars){ $query_vars[]=’country’; return $query_vars; } Is it becasue I removed the … Read more

404 Error On Custom Taxonomy Pages 2, 3, etc

I’ve been reading a bunch of posts about this with no luck so far. I can’t seem to figure out what is the problem. I have the following: Custom Post Type: Sermons Custom Taxonomy: Series My urls right now look like this mysite.com/Sermons/ParentTerm/ChildTerm/Post When viewing the Parent Term of the series taxonomy the first page … Read more

nginx + W3 Total Cache: rewrite rules issue [closed]

Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for WordPress Development Stack Exchange. Closed 7 years ago. Improve this question nginx 1.2.7 + WP 3.5.1 + W3TC 0.9.2.8. Rewrite rules generated by the plugin simply don’t work, server returns 404 after … Read more

Getting 404 when using rewrite rule for posts

So I need to have page slug Blog before post title I used rewrite rule to achieve this but doing this resulting me in 404 errors for paginations the below is the code I used to rewrite. add_action( ‘init’, ‘my_new_default_post_type’, 1 ); function my_new_default_post_type() { register_post_type( ‘post’, array( ‘labels’ => array( ‘name_admin_bar’ => _x( ‘Post’, … Read more

add_rewrite_rule with trailing slash redirects

I have made my own routes by using add_rewrite_rule method. I would like to know if it is possible using given method to force all my created routes to redirect to URL where there is trailing slash in the end. For example if i do add_rewrite_rule(‘^my-route/’, ‘index.php?_my_route=1’, ‘top’) or add_rewrite_rule(‘^my-route’, ‘index.php?_my_route=1’, ‘top’) and i make … Read more

Can’t get pretty permalinks to work without index.php

I’ve worked with WordPress for a while now and this is the first time I’ve had this problem, I can’t get my permalinks to work without index.php on the URL even though mod_rewrite is enabled, a few things that might help figure the problem out: I’m using apache2 and mod_rewrite is enabled, I doubled checked … Read more