Answer the question
In order to leave comments, you need to log in
How to exclude from 301 redirect url with certain part?
In htaccess, with this line, all pages with .html at the end are sent with a 301 redirect to their counterpart without .html
RedirectMatch 301 (.*)\.html$ /$1/
I need this rule not to work for links that have the component .../ order/xxx.html. This option doesn't work for me:
RewriteCond %{REQUEST_URI} !^/order
RewriteRule ^(.*)\.html$ /$1/ [R=301,L]
This kind of exception doesn't work either:
RewriteCond %{REQUEST_URI} ! ^/order\.html$
Tell me, please, how to write an exception correctly.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question