I'm trying to redirect a number of long style product URLs that have the category codes in them to the short style URL
Here's what is already in place
I did try this
but still wound up with a URL like this
what am I missing?
Leslie
HTML Code:
http://www.domain.com/Merchant2/merchant.mvc?Screen=PROD&Store_Code=ABC&Product_Code=XYZ&Category_Code=123
Here's what is already in place
Code:
### Begin - Dynamic to Short Link 301 Redirect
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^product/([^/.]+).html$ /Merchant2/merchant.mvc?Screen=PROD&Product_code=$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^category/([^/.]+).html$ /Merchant2/merchant.mvc?Screen=CTGY&Category_code=$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^([^/]+)/([^/.]+).html$ /Merchant2/merchant.mvc?Screen=PROD&Category_code=$1&Product_code=$2 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^([^/.]+).html$ /Merchant2/merchant.mvc?Screen=$1 [QSA,L]
### End - Inserted by Miva Merchant
RewriteCond %{QUERY_STRING} ^Screen=CTGY&Store_Code=ABC&Category_Code=(.*)$
RewriteRule ^(.*)$ http://www.domain.com/category/%1.html? [R=301,L]
RewriteCond %{QUERY_STRING} ^Screen=PROD&Store_Code=ABC&Product_Code=(.*)$
RewriteRule ^(.*)$ http://www.domain.com/product/%1.html? [R=301,L]
Code:
RewriteCond %{QUERY_STRING} ^Screen=PROD&Store_Code=ABC&Product_Code=(.*)&Category_Code=(.*)$RewriteRule ^(.*)$ http://www.domain.com/product/%1.html? [R=301,L]
HTML Code:
http://www.domain.com/product/productcode&Category_Code=123.html
Leslie
Comment