I just upload my new website, and i would like to do some 301 redirections for the SEO.
My old website had URL like : http://www.myoldwebsite.com/contact/?lang=fr, http://www.myoldwebsite.com/accueil/?lang=fr, http://www.myoldwebsite.com/photos/?lang=fr
I would like to do some redirections :
http://www.myoldwebsite.com/contact/?lang=fr TO http://www.myoldwebsite.com/contacts
http://www.myoldwebsite.com/accueil/?lang=fr TO http://www.myoldwebsite.com/accueil
http://www.myoldwebsite.com/photos/?lang=fr TO http://www.myoldwebsite.com/gallery
I made redirections like this in my .htaccess but it’s impossible to combine several redirections …
RewriteCond %{REQUEST_URI} /contacts/$
RewriteCond %{QUERY_STRING} ^lang=(.*)
RewriteRule (.*) http://www.mywebsite.com/contact/? [R=301,L]
How to make it ?
Thanks a lot 🙂
Have a nice day !
2
Answers
http://www.htaccessredirect.net
I haven’t give it a try but this might work for you.
It’s easy, you should use multiple
RewriteCond
conditions in your.htaccess
file: