Reputation: 480
I have an issue in my RedirectMatch 301 rule.
I want to redirect all urls like theses:
http://www.toto.com/lang/fr/tutu/salut-les-gens
http://www.toto.com/lang/fr/tutu/trop-bien
http://www.toto.com/lang/fr/tutu/gg-a-toi
to:
http://www.toto.com/blog/tutu/salut-les-gens
http://www.toto.com/blog/tutu/trop-bien
http://www.toto.com/blog/tutu/gg-a-toi
I have set this rules:
RedirectMatch 301 ^/lang/fr/tutu/.* /blog/tutu/$1
but it's redirections to http://www.toto.com/blog/tutu and not http://www.toto.com/blog/tutu/salut-les-gens
Thanks !
Upvotes: 1
Views: 987
Reputation: 30496
You need parentheses to capture content and reuse it in a variable. And you should first try your rules with 302 codes, and not 301. So that if you make any mistake you do not have to close your browser to re-test the new rule (with 301 the browser is not requesting anymore the web server after the first answer).
RedirectMatch 302 ^/lang/fr/tutu/(.*) /blog/tutu/$1
Upvotes: 2