I am trying to redirect a large number of 404s. Some old sites related
http://example.com/product.tmpl?SKU=XXX
to XXXis a SKU number.
I want it redirected to
http://example.com/product.php?SKU=XXX
I got here, but it still doesn't work. Do I have a typo in my code?
RewriteEngine On
RewriteCond %{QUERY_STRING} ^SKU=([^&]+)
RewriteRule ^/?product\.tmpl$ /product.php?SKU=%1 [L,R=301]
EDIT: my full htaccess file reads like this:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^SKU=([^&]+)
RewriteRule ^/?product\.tmpl$ /product.php?SKU=%1 [L,R=301]
<IfModule mod_rewrite.c>
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
n1nja source
share