Grabbing a couple of htaccess rewrite rules that will come in handy when switching a Miva Merchant store form the long style links to the friendlier short links. It’s a best practice to always redirect every lingering link out there to its new shorter version.
The first one is from Brennan at Miva Merchant with a note to make sure the Query String matches exactly what the URL looks like:
RewriteCond %{QUERY_STRING} ^Screen=CTGY&Category_Code=(.*)$
RewriteRule ^(.*)$ http://www.domain.com/category/%1.html? [R=301,L]RewriteCond %{QUERY_STRING} ^Screen=PROD&Product_Code=(.*)$
RewriteRule ^(.*)$ http://www.domain.com/product/%1.html? [R=301,L]
The second comes from David, also from Miva Merchant:
RewriteCond %{REQUEST_URI} ^/Merchant2/merchant.mvc
RewriteCond %{QUERY_STRING} Screen=PROD&Product_Code=(.*) [NC]
RewriteRule ^(.*)$ http://www.domain.com/product/%1.html? [R=301,L]RewriteCond %{REQUEST_URI} ^/Merchant2/merchant.mvc
RewriteCond %{QUERY_STRING} Screen=CTGY&Category_Code=(.*) [NC]
RewriteRule ^(.*)$ http://www.domain.com/category/%1.html? [R=301,L]