htaccess 301 rewrite help

[quote name=‘kvanlaar’]Doesn’t RewriteCond only look at the string following the ? mark in the URL…I am trying to understand this all…



[URL]http://www.qualitypromosplus.com/agoracart55/agora.cgi?p_id=00001[/URL]



I thought it only looked at p_id=00001[/quote]



Don’t ask, try it!

I ended up going with this.



It redirects regardless if the page exists.



If I do not include agora.cgi in the pattern match string, it will not be substituted and show up in the resulting URL string…In addition, if you do not include the ? at the end, the entire old query string variable shows up in the resulting URL string as well.





redirect 301 /agoracart55/agora.cgi [url]http://www.qualitypromosplus.com/store/index.php?[/url]

[quote name=‘kvanlaar’]I ended up going with this.



It redirects regardless if the page exists.



If I do not include agora.cgi in the pattern match string, it will not be substituted and show up in the resulting URL string…In addition, if you do not include the ? at the end, the entire old query string variable shows up in the resulting URL string as well.





redirect 301 /agoracart55/agora.cgi [URL]http://www.qualitypromosplus.com/store/index.php?[/URL][/quote]



What you are talking about?

You redirect a “string” and not a physical url.



And why do you use redirect 301 /agoracart55/agora.cgi [URL]http://www.qualitypromosplus.com/store/index.php?[/URL]instead of this?


RewriteEngine on
RewriteCond %{query_string} /agoracart55/
RewriteRule (.*) http://www.yourdomain.xy/? [R=301,L]

[quote name=‘indy0077’]What you are talking about?

You redirect a “string” and not a physical url.



And why do you use redirect 301 /agoracart55/agora.cgi [URL]http://www.qualitypromosplus.com/store/index.php?[/URL]instead of this?


RewriteEngine on
RewriteCond %{query_string} /agoracart55/
RewriteRule (.*) http://www.yourdomain.xy/? [R=301,L]
[/QUOTE]



I guess because what I did works and seems to accomplish what I need though I don’t profess to understand the differences between what I did and what you suggested. If there is a specific reason I should not do it like I did it and use your method holler out!

Apreciate if some can help on redirect…



We closed our store (domain xyz.com with 134sp3) and want to do redirect all the links of this store to our another store abc.com (also on 134sp3). Both the store have the same products/categories/SEO links only domain name changes.



TIA

Hi all, this is brilliant and thank you all for your help with this subject it works a treat.



Google has unfortunately indexed all the old url’s with product_id etc and there are over 800 pages in googles index with that appended for all the products in my store. How can I get google to index the latest SEO friendly urls. If i need to do a 301 redirect on ALL of the pages in my store…all 800 of them for google to start crawling them, is there an easy way of doing this?



Regards

[quote name=‘AmitP’]…is there an easy way of doing this?



Regards[/quote]

Not really.

[quote name=‘AmitP’]Hi all, this is brilliant and thank you all for your help with this subject it works a treat.



Google has unfortunately indexed all the old url’s with product_id etc and there are over 800 pages in googles index with that appended for all the products in my store. How can I get google to index the latest SEO friendly urls. If i need to do a 301 redirect on ALL of the pages in my store…all 800 of them for google to start crawling them, is there an easy way of doing this?



Regards[/QUOTE]





Been there done that. You could try the method I used, i did over 1200 301’s… took me about 6 hours.



[url]http://forum.cs-cart.com/showthread.php?t=15626[/url]