.htaccess tutorial

htaccess Elite


Can I allow a specific domain from being blocked?

Anything not fitting into other categories

Can I allow a specific domain from being blocked?

Postby Slacker » 18 Jul 2008 08:17

To block hackers that are often behind a proxy, I have added this to my .htaccess:

RewriteCond %{HTTP:VIA} !^$ [OR]
RewriteCond %{HTTP:FORWARDED} !^$ [OR]
RewriteCond %{HTTP:USERAGENT_VIA} !^$ [OR]
RewriteCond %{HTTP:X_FORWARDED_FOR} !^$ [OR]
RewriteCond %{HTTP:PROXY_CONNECTION} !^$ [OR]
RewriteCond %{HTTP:XROXY_CONNECTION} !^$ [OR]
RewriteCond %{HTTP:HTTP_PC_REMOTE_ADDR} !^$ [OR]
RewriteCond %{HTTP:HTTP_CLIENT_IP} !^$
RewriteRule ^.* - [F]

Unfortunately, one member can“t access the site from her job at a govermental organization. I suggested that she try to access the site through a web proxy, like http://www.the-cloak.com/ . But she are not allowed to access these type of sites either at her job. Is it possible to allow her domain or ip-range in .htaccess, so she can access my site? Can she do anything herself to be able to access the site?
Slacker
 
Posts: 3
Joined: 18 Jul 2008 08:14

Re: Can I allow a specific domain from being blocked?

Postby Slacker » 04 Aug 2008 08:20

I have Googled and found this suggestion to unblock a certain domain, although it seems not to be tested:

RewriteCond %{HTTP_REFERER} !.*allowedproxydomain.com.*

Will it work?
Slacker
 
Posts: 3
Joined: 18 Jul 2008 08:14

Re: Can I allow a specific domain from being blocked?

Postby Slacker » 07 Aug 2008 05:34

It did not work and I tried this:

RewriteCond %{HTTP_REFERER} !.*www.site.com.*
RewriteCond %{HTTP:VIA} !^$ [OR]
RewriteCond %{HTTP:FORWARDED} !^$ [OR]
RewriteCond %{HTTP:USERAGENT_VIA} !^$ [OR]
RewriteCond %{HTTP:X_FORWARDED_FOR} !^$ [OR]
RewriteCond %{HTTP:PROXY_CONNECTION} !^$ [OR]
RewriteCond %{HTTP:XROXY_CONNECTION} !^$ [OR]
RewriteCond %{HTTP:HTTP_PC_REMOTE_ADDR} !^$ [OR]
RewriteCond %{HTTP:HTTP_CLIENT_IP} !^$
RewriteRule .* - [F]

I also tried this line with the same result:
RewriteCond %{HTTP_REFERER} !^http://(www\.)?site\.com

http://www.site.com was the domain name I wanted to allow to my site
Slacker
 
Posts: 3
Joined: 18 Jul 2008 08:14


Return to Main



cron