Redirecting instead of rewriting
-
Hi everyone,
I have created a rewrite rule that work fine on a first website.
I have used the same rule on a second website, but instead of rewrite, WP is redirecting…
The main difference between the 2 websites is the second is a multisites. I don’t know if it make a difference for rewriting rules.Here is my code in functions.php :
function URLbateau( $query_vars ){ $query_vars[] = 'bateau'; $query_vars[] = 'gamme'; return $query_vars; } add_filter( 'query_vars', 'URLbateau' ); function rewritebateau() { global $wp_rewrite; add_rewrite_rule( '^les-bateaux/(.*)/(.*)?', 'index.php?pagename=bateaux&bateau=$matches[2]&gamme=$matches[1]', 'top' ); }
So, when I display an URL like: /les-bateaux/gamme-premium/tarpon-49-qp
I’m redirected to /bateaux/An idea?
Thanks!
Laurent
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Redirecting instead of rewriting’ is closed to new replies.