add_rewrite_rule causing redirection problem
-
I have a url structure for my custom taxonomy called ‘feature’ in the format;
http://www.mysite.com/feature/term/child-term/
What I’m trying to do is add a rewrite to the beginning to allow me to prefix a set of values (asia|europe|africa).
So that a request to;
http://www.mysite.com/asia/feature/term/child-term/
would translate the url back to the url at the top, then add asia to the query var.
I’ve written a rewrite that does seems to do it when i test in a regex tester, however its causing a redirection error in the browser
add_rewrite_rule('^(europe|asia|africa)/([^/]+/)*([^/]+)/?','index.php?feature=$matches[3]&prefix=$matches[1]','top');
ie it should go to; index.php?feature=term-name&prefix=asia
Perhaps I’m missing something but this has me stumped
Any help appreciated
- The topic ‘add_rewrite_rule causing redirection problem’ is closed to new replies.