Forum Moderators: phranque

Message Too Old, No Replies

Blocking Domain and Browser

Is it possible to block a domain name in combination with specific browser

         

Clay213

4:36 pm on Jul 15, 2005 (gmt 0)

10+ Year Member



I have had no luck searching for this specific circumstance so I apologize if it has been covered.

I would like to be able to block some users from my site. I know the domain they are coming from, and I know they only use Macs and Safari.

Anyone who I would like to be able to view the site from that domain uses PCs.

Is it possible to either in htaccess or using php to write a trap which will catch:

Mac users coming from domain hr.cox.net?

The ip addresses are dynamic

Span

10:11 pm on Jul 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



With .htaccess this serves a 403 to anyone from cox.net and Safari. Before using this you should know if HostnameLookups is enabled. If it is not (I believe HostnameLookups by default is Off) you're not only banning Safari users from cox.net but everyone using Safari. Better use PHP in that case.


RewriteEngine On
RewriteCond %{REMOTE_HOST} cox\.net$
RewriteCond %{HTTP_USER_AGENT} Safari [NC]
RewriteRule .* - [F]