Magento: redirecting some htaccess not working

As of magento 1.7 FR, I have some redirect rules in htaccess but not all work and I cannot find why:

Options +FollowSymLinks
RewriteEngine on

# This is working
Redirect 301 /blog/conseils-literie/literie-et-matelas-pirelli.html http://example.com/produits/literie.html
Redirect permanent /catalogues/ http://example.com/

# This is not working !
Redirect 301 /produits.html?marque=32 http://example.com/32/bultex.html
# I replaced it with this but no way !
RewriteCond %{HTTP_HOST} ^example.com/produits.html?marque=32
RewriteRule ^(.*)$ http://example.com/32/bultex.html$1 [R=301,L]

      

I'm pretty sure there is no url redirect from the backend!

+3


source to share


1 answer


This works fine on my server:

RewriteCond %{THE_REQUEST} /produits\.html\?marque=([^&\s]+) [NC]
RewriteRule ^ /%1/bultex.html? [NE,NC,R,L]

      



Remove or comment out the redirect line in your .htaccess and put that rule there. Do not delete ? from the end of the target URL, otherwise the query string "? Marque = 32" will be appended to it, and the URL will look like this:

/32/bultex.html?marque=32

      

+1


source







All Articles