Old query String hard coded 301 url redirection using htaccess
Posted
by
Nilesh Toshniwal
on Stack Overflow
See other posts from Stack Overflow
or by Nilesh Toshniwal
Published on 2011-01-01T05:09:19Z
Indexed on
2011/01/01
13:54 UTC
Read the original article
Hit count: 222
.htaccess
I have recently changed CMS of my website and now looking to redirect old urls like:
oldpage.php?key=7cdb93c26
to some new urls but I want all of them in hard coded way and it should be a 301 redirect
I tried the following rules but none of them work for me
redirect 301 /oldpage.php?key=7cdb93c26 http://www.mynewsite.com/my-new-page.html
redirect 301 "/oldpage.php?key=7cdb93c26" http://www.mynewsite.com/my-new-page.html
RewriteRule ^oldpage.php?key=7cdb93c26$ http://www.mynewsite.com/my-new-page.html [L,R=301]
RewriteRule ^oldpage.php?key=7cdb93c26$ /my-new-page.html [L,R=301]
© Stack Overflow or respective owner