V
V
vinznsk2019-02-22 11:15:31
System administration
vinznsk, 2019-02-22 11:15:31

How to set redirect exception in .htaccess?

Good afternoon!
Help, please, to understand.
On the site https://stoppestinfo.com , you need to add exceptions for the page https://stoppestinfo.com/es, in the rule
# add .html
RewriteEngine On
RewriteCond %{REQUEST_URI} (.*/[^/.]+)($ |\?)
RewriteRule .* %1.html [R=301,L]
RewriteRule ^(.*)/$ /$1.html [R=301,L]
To make the redirect work for all pages except this one.
Tried to do
- RewriteRule ^/es$ - [L]
- RewriteCond %{THE_REQUEST} !^\S+\s/es$
Doesn't work, in the first case - error 500.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2019-02-22
@shambler81

so deny it!

RewriteEngine On
RewriteCond %{REQUEST_URI} (.*/[^/.]+)($|\?)
RewriteCond %{REQUEST_URI} !^/es [NC]
RewriteRule .* %1.html [R=301,L]
RewriteRule ^(.*)/$ /$1.html [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question