You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jos Chrispijn <ap...@webrz.net> on 2010/02/14 16:23:26 UTC

[users@httpd] Redirect on bases of ip address

Can someone tell me how I can redirect visitors to either index.php or 
index.html on basis of their ip address?
I am in the process of building a new website and only for my own ip 
address I want to get access to the new site (index.php) and have all 
other visitors been redirected to the old website (index.html + 
redirection).

thanks in advance
Jos Chrispijn



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Redirect on bases of ip address

Posted by Nilesh Govindarajan <li...@itech7.com>.
On 02/14/2010 08:53 PM, Jos Chrispijn wrote:
> Can someone tell me how I can redirect visitors to either index.php or
> index.html on basis of their ip address?
> I am in the process of building a new website and only for my own ip
> address I want to get access to the new site (index.php) and have all
> other visitors been redirected to the old website (index.html +
> redirection).
>
> thanks in advance
> Jos Chrispijn
>
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>

RewriteEngine On
RewriteCond %{REMOTE_ADDR} abc\.def\.ghi\.jkl
RewriteRule ^(.*)$ /index.html [L,R=302]

-- 
Nilesh Govindarajan
Site & Server Adminstrator
www.itech7.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org