Tell me how to create a forwarding directive in htaccses with the definition condition by ip
Example:
если ip=2.2.2.2 или 3.3.3.3 то 301 редирект на site.ru Tell me how to create a forwarding directive in htaccses with the definition condition by ip
Example:
если ip=2.2.2.2 или 3.3.3.3 то 301 редирект на site.ru RewriteEngine On RewriteCond %{REMOTE_ADDR} ^2\.2\.2\.2$ [OR] RewriteCond %{REMOTE_ADDR} ^3\.3\.3\.3$ RewriteRule .* http://site.ru/ [R=301,L] UPD Online calculators say that for 86.102.72.240/28 ->
Хост(min): 86.102.72.241 Хост(max): 86.102.72.254 then the whole range can be written in one regular order and the rule will be:
RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)?site\.org RewriteCond %{REMOTE_ADDR} ^86\.102\.72\.2(4[1-9]|5[0-4])$ RewriteRule .* http://site.ru/ [R=301,L] RewriteCond %{REMOTE_ADDR} ^3\.3\.3\. , RewriteCond %{REMOTE_ADDR} ^3\.3\. . Or do not load .htaccess rules, and move all the logic from it to the router ru.stackoverflow.com/questions/542869/… - VismanSource: https://ru.stackoverflow.com/questions/552339/
All Articles