Web Hosting Talk







View Full Version : .htaccess


babbsela
04-10-2002, 09:28 PM
I need to restrict access to a website, by allowing all access except for a particular referrer. One of my sites is linked to by an offensive site and we'd like to make sure the visitors to that site can't click through to ours.

For example, this code in an .htaccess file:

AuthUserFile /dev/null
AuthGroupFile /dev/null
AuthName "Deny Joanne"
AuthType Basic

<Limit GET>
order allow,deny
allow from all
deny from .net-werkz.com
deny from 216.103.133.181
</Limit>

doesn't block the click throughs, because that is not the hostname. We don't want to deny all the sites at that host, just the net-werkz one.

Any ideas?

TIA

webx
04-10-2002, 11:49 PM
You need to use mod-rewrite, and create a recipe to block based on the referer. I don't have one handy, may be someone can post one for you.