Answer the question
In order to leave comments, you need to log in
How to add redirect exceptions in htaccess?
Help with htaccess redirect please. It is necessary that everyone except my ip address and search robots be redirected. Here's a design that doesn't work. That is, the redirection itself works, only it also throws me to another site.
RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^1.2.2.1$
RewriteCond %{HTTP_USER_AGENT} !(YandexBot|Googlebot|Bingbot|Slurp|DuckDuckBot|Baiduspider|Mail.Ru)
RewriteCond %{HTTP_HOST} ^site1\.ru$ [NC]
RewriteRule ^(.*)$ site2.ru/$1 [L,R=301]
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