Blocking access based on referrer...?
September 3, 2006 12:16 PM
Subscribe
Is it possible to restrict access to a web page (or whole site) based on the referrer?
I noticed that a site I manage (which includes a phpbb forum) has been getting traffic off of the google search "inurl posting.php?mode=newtopic". I'm pretty sure this is one of the ways spammers and/or spambots are finding the forum.
Specific to my problem, is there any way to restrict access to visits coming from that search? Through scripting? .htaccess? etc?
And out of general interest, is there a way to block access based on referrers?
posted by poweredbybeard to computers & internet (10 comments total)
1 user marked this as a favorite
RewriteEngine on
# Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} inurl posting\.\?mode\=newtopic [NC]
RewriteRule .* - [F]
That will block anyone trying to access the site from a URL with the string you mention above. I think.
posted by Civil_Disobedient at 12:35 PM on September 3, 2006