Redirect a specific IP address to a special page of my homepage with .htaccess

Posted by Jim Knopf on Stack Overflow See other posts from Stack Overflow or by Jim Knopf
Published on 2010-03-13T17:41:07Z Indexed on 2010/03/13 17:45 UTC
Read the original article Hit count: 228

Filed under:
|
|

How can I use .htaccess to forward a visitor of a specific IP address to a webpage on my server?

This example causes an infinite loop:

RewriteCond %{REMOTE_ADDR} ^123\.\123\.123\.123$
RewriteRule ^(.*)$ /specialpage.php [R,L] 

I found this on the web but it just does not work:

SetEnvIf REMOTE_ADDR 123.123.123.123 REDIR="redir"
RewriteCond %{REDIR} redir
RewriteRule ^(.*)$ /specialpage.php

Note: My website consists of .htm, html and .php pages.

Your help would be very much appreciated.

© Stack Overflow or respective owner

Related posts about htaccess

Related posts about redirect