Answer the question
In order to leave comments, you need to log in
How to add exception to redirect rule in htaccess?
This is how I redirect all requests to oldsite to newsite:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^oldsite\.ru
RewriteRule ^(.*)$ http://newsite.ru/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www.oldsite\.ru
RewriteRule ^(.*)$ http://newsite.ru/$1 [R=301,L]
Answer the question
In order to leave comments, you need to log in
I think it's obvious, use negation!
RewriteCond %{HTTP_HOST} ^oldsite\.ru
RewriteCond %{REQUEST_URI} ^!camera/$
RewriteRule ^(.*)$ http://newsite.ru/$1 [R=301,L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question