Forum Moderators: phranque

Message Too Old, No Replies

Redirects with question mark

301 divert help please

         

David3733

6:12 pm on May 22, 2009 (gmt 0)

10+ Year Member



Hello People, I have been pulling my hair out for many many hours, very worried about losing my google links.

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

David3733

6:57 pm on May 22, 2009 (gmt 0)

10+ Year Member



I have tried

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

g1smd

8:20 pm on May 22, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Redirect and RedirectMatch cannot 'see' query string data.

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.