문제

I'm trying to redirect specific IPs to another page but with the code I have below it's redirecting every visitor. this is what I have:

<IfModule mod_rewrite.c>
 RewriteEngine On

 Rewrite Cond %{(}REMOTE_ADDR} ^103\.11\.52\.115 [OR]
 Rewrite Cond %{(}REMOTE_ADDR} ^103\.11\.52\.116 [OR]
 Rewrite Cond %{(}REMOTE_ADDR} ^103\.11\.52\.118 [OR]
 Rewrite Cond %{(}REMOTE_ADDR} ^176\.67\.84\.253 [OR]
 Rewrite Cond %{(}REMOTE_ADDR} ^176\.67\.81\.161
 RewriteRule ^(.*)$ http://www.anotherpageonsitehere.com/page/04/index.php [L]

</IfModule>

how do I only redirect the IPs I want?

도움이 되었습니까?

해결책

Syntax error I'd say... Try this instead:

<IfModule mod_rewrite.c>
 RewriteEngine On

 RewriteCond %{REMOTE_ADDR} ^103\.11\.52\.115 [OR]
 RewriteCond %{REMOTE_ADDR} ^103\.11\.52\.116 [OR]
 RewriteCond %{REMOTE_ADDR} ^103\.11\.52\.118 [OR]
 RewriteCond %{REMOTE_ADDR} ^176\.67\.84\.253 [OR]
 RewriteCond %{REMOTE_ADDR} ^176\.67\.81\.161
 RewriteRule ^(.*)$ http://www.anotherpageonsitehere.com/page/04/index.php [L]

</IfModule>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top