Forum Moderators: phranque
I have just moved my site and have around 5,500 links that i thought would be easy to go something like
redirect 301 \index.php?cname=product-bla http:\\domainname.com\bla
had them allready in my ht access for the move, didnt realise that ? doesnt work
spent all day trying to get them to work, dont really understand rewriterules etc
please could someone give me a easy way out to save the day, I have access to my user http Conf and my htaccess
I have tried many ways but all seem to be breaking,
Thank you for any assitance you may be able to give
RedirectMatch 301 \index.php?cname=product-bla http:\\domainname.com\bla
301 \index.php\?cname=product-bla http:\\domainname.com\bla
301 ^\index.php?cname=product-bla& http:\\domainname.com\bla
301 ^\index.php(.*)cname=product-bla& http:\\domainname.com\bla
301 ^\index.php[?]cname=product-bla& http:\\domainname.com\bla
any pointers? please bear in mind i have over 5,500 lines to get in so something like the above i could mess around with in a text editor
Thank you
You need to use RewriteRule with the [R=301,L] flags.
Test the QUERY_STRING with a preceding RewriteCond.
If you look at the URLs to be redirected, looking for common patterns, it is likely that a very small number of rules can take care of all of them.