want to allow only few IP's to access the website
4 posts
• Page 1 of 1
want to allow only few IP's to access the website
Hello!
Please show me the code to allow only few IP's to access the website rest block
Please show me the code to allow only few IP's to access the website rest block
Re: want to allow only few IP's to access the website
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]
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]
Re: want to allow only few IP's to access the website
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]
RewriteBase /
RewriteCond %{HTTP_HOST} ^(?:www\.)?real-estate\.com$
RewriteCond %{REMOTE_ADDR} !^.*(?:59\.181\.144\.160|12\.99\.0\.900)
RewriteRule .? - [F]
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 18 guests