want to allow only few IP's to access the website

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 5
Joined: 29 Dec 2012, 03:39

want to allow only few IP's to access the website

04 Jun 2013, 03:10

Hello!
Please show me the code to allow only few IP's to access the website rest block

User avatar
Posts: 5
Joined: 29 Dec 2012, 03:39

Re: want to allow only few IP's to access the website

04 Jun 2013, 03:55

I want that one of the 10 domains that I have mapped on the same physical folder should be accessible to IP 59.181.144.160
Example I want real-estate.com to be accessible by IP 59.181.144.160 only
first I need to state that this condition is for only real-estate.com of the other domains mapped with the same htaccess file
then I need to state its only this IP 59.181.144.160 to allow access ...there is one more twist what if i need to add one more IP to allow access say IP 12.99.0.900 how will the code be written ... please guide me ... all help will be appreciated
RewriteCond %{HTTP:Host} ^(?:www\.)?real-estate\.com$
RewriteCond %{REMOTE_ADDR} !^59.181.144.160$
RewriteRule /.? - [NC,F,L]

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: want to allow only few IP's to access the website

04 Jun 2013, 09:04

Please try it like this:


RewriteBase /
RewriteCond %{HTTP_HOST} ^(?:www\.)?real-estate\.com$
RewriteCond %{REMOTE_ADDR} !^.*(?:59\.181\.144\.160|12\.99\.0\.900)
RewriteRule .? - [F]

User avatar
Posts: 5
Joined: 29 Dec 2012, 03:39

Re: want to allow only few IP's to access the website

04 Jun 2013, 11:35

Thankyou Anton it works well.

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 18 guests