Remove subdirectory from links
Remove subdirectory from links
Remove subdirectory from links
I found out ! I just had to declare the paged rewrite rule before the non-paged rewrite rule… add_rewrite_rule( ‘activities/([^/]+)/page/([0-9]{1,})/?’, ‘index.php?tag=$matches[1]&product_cat=activities&pages=$matches[2]’, ‘top’ ); add_rewrite_rule( ‘activities/tag/([^/]+)’, ‘index.php?tag=$matches[1]&product_cat=activities’, ‘top’ );
Overcoming a complex WordPress page rewrite rules request
Rewrite URL of Specific Post of Custom Type
Here you go: compare\/([^-vs-]*)(?:-vs-)([^-vs-]*)(?:-vs-)?([^-vs-]*)? Remember to escape backslashes (as I have done). I also made your lookups more consistent in their internal logic/structure. I assumed you wouldn’t want a second -vs- if the third product wasn’t there, so this is why you now have the second non-capturing group. Here is a link with the answer … Read more
WordPress Rewrite Rule to EITHER Match 1 or 2 Taxonomies when adding to URL
Why is there a 404 on page 2+ for my search page?
Try adding a query var add_filter(‘query_vars’, ‘foo_my_query_vars’); function foo_my_query_vars($vars){ $vars[] = ‘question’; return $vars; }
custom rewrite rules will not be added to wordpress rewrite_rules database
If you want a rewrite rule that loads a post type archive from a different URL, the simplest way is via an internal rewrite, which doesn’t get inserted into .htaccess. Internal rewrites map URLs to query arguments, and must result in a successful main query: add_rewrite_rule( ‘some_url/?$’, ‘index.php?post_type=yourcpt’, ‘top’ );