rewrite_rule – working fine but broken single post 404

I’m having an issue with my rewrite rule, works fine here:

example.com/resources/   
example.com/resources/articles/

Also works fine with the pagination here:

Read More
example.com//resources/articles/page/2/   
example.com//resources/articles/page/3/  
example.com//resources/articles/page/4/

But when I click on a single post I get a 404:

example.com/resources/articles/new-test-for-single-post

Here is my code for my rewrite:

add_rewrite_rule("^resources/([0-9]+)/(.+?)?$",'index.php?taxonomy=res_category&term=$matches[1]&post_type=$matches[2]','top');
add_rewrite_rule( '^resources/(.+?)(/page/([0-9]+))?/?$', 'index.php?taxonomy=res_category&term=$matches[1]&post_type=$matches[2]&paged=$matches[3]', 'top');

Any suggestions what im doing wrong ?

Related posts

1 comment

  1. Try going to Settings->Permalinks and just saving your permalinks a couple times. I’ve seen that problem happen many times and saving the permalinks flushes the rewrite rules.

Comments are closed.