Forum Moderators: phranque
I've done most of the conversion, I just need to add an .htaccess redirect so that all of the old catalog pages that are indexed point to the new catalog pages.
After reading through the thread on redirecting (from the WW homepage), I'm a bit confused on which redirect formatting I should use.
Since Miva sometimes adds many variables, I'm not sure how to create an htaccess file that encompasses all the ways that miva links to products.
Here's a sample line from my htaccess:
# Send a redirect from our old file to our new file
redirect permanent h*tp://www.widget-fake-url.com/merchant.mv?Screen=PROD&Store_Code=GOESHERE&Product_Code=PRODUCT01 h*tp://www.widget-fake-url.com/store/product01.html
The problem comes when sometimes Miva interally links to a product, it sometimes adds a &Category_Code=cat01 to the product URL.
So the another URL for the same product above would be:
h*tp://www.widget-fake-url.com/merchant.mv?Screen=PROD&Store_Code=GOESHERE&Product_Code=PRODUCT01&Category_Code=cat01
Is there a way to do a permanent redirect that encompasses anything after the &Product_Code=PRODUCT01 and still redirects it to product01.html?
Hope this makes sense :)
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{QUERY_STRING} Product_Code=([^&]+)
RewriteRule ^merchant\.mv$ http://www.example.com/store/%1.html [R=301,L]
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{QUERY_STRING} Product_Code=([^&]+)
RewriteRule ^merchant\.mv$ http://www.example.com/%1.html [R=301,L]
See the references cited in our forum charter [webmasterworld.com] for more information on how to modify this code if necessary after you've tested it.
Jim
This copies the value of the variable named Product_Code into internal variable %1, and then uses it to construct the new URL.
The old URL and the new URLs are going to be completely different.
From what I understand of the code you posted, it is making the miva URL and turning it into a static looking URL (that doesn't actually exist).
What I'm trying to do is basically forward all traffic from old page to new totally separate page.
Just like if you had a website where you were changing all of your pages from page1.html, page2.html, page3.html to joe.html, dog.html, help.html.
The existing product URLs have established search engine placement, so I want to make sure those visitors that click on the serps (or any internal links that I forget to change) automatically get forwarded to the completely separate catalog url page that is now up and running.
I apologize if the code you posted does exactly what I just described...I just got the feeling we were talking about 2 different things?
/merchant.mv?<anything>Product_Code=<any-product-code><anything else>
to
/<any-product-code>.html
This allows many old URLs to be redirected without having to have a unique directive for each old URL.
Is there a way to do a permanent redirect that encompasses anything after the &Product_Code=PRODUCT01 and still redirects it to product01.html?
That is the problem that I addressed.
Jim