Reputation: 167
I have a URL with 2 parameters /manufacturer/product.html
and I need to redirect to the URL without "manufacturer", ie. /product.html
RewriteRule ^\/manufacturer\/(.*)$ \/$1 [L]
This does not work.
can you help me?
Upvotes: 0
Views: 38
Reputation: 2612
Here is the code that will work for you, make sure you paste this in your root .htaccess file. (rename the current .htaccess file to .htaccess.bak and paste the below code in a new .htaccess file in root directory)
RewriteEngine on
RewriteRule ^manufacturer/product\.html$ /product.html? [L,R]
When everything works as it should, you may replace R
with R=301
(permanent redirect).
Upvotes: 1