Log in

View Full Version : Block a webpage reffer?


TaP
01-22-2002, 02:10 AM
Someone posted my board on a website that is inapropriate for my audience, is there any way I can get it so no one from that website can enter my board? Say, they have my link on their site, I want it to if they click on that link (on their site) that it will block whoever comes from there...is this possible?

Kinda hard to explain, hope you can understand me.

Once more just to clear things up...

Say someone has my link on their site, and I don't want anyone that clicks on that link, to come to my site, is there any way I can block it so anyone that clicks that link on their site, that they cant enter my board? Kinda like a refferer block?

Thanks
Patrick

Admin
01-22-2002, 08:08 AM
Place this in your config.php file, but change vbulletin.org to their domain (without www!):
if (strstr($HTTP_REFERER, 'vbulletin.org')) {
sleep(900);
}
this will make the page "load" for them for 15 minutes... so unless they wait 15 minutes they will never see the page.

You can just use exit; instead of the sleep() call, but I find it more fun to just let them see in front of the screen waiting for the page to load. ;)

Xelation
01-22-2002, 05:03 PM
hehe, Yeah to bad you couldn't see them get frustrated...lol

JamesUS
01-22-2002, 05:42 PM
While sleep(); is much more fun ;) it is safer to use exit; as if a few people hit that link at the same time, you could kill the server as rogue apache processes are left lying around for 15 minutes.

TaP
01-23-2002, 08:14 PM
Thanks guys...is there any way to block all web page refferers? So if I want to shut my site down for a little bit, no one can link it...to have less traffic?

irn-bru
01-19-2004, 07:27 PM
I had a few naughty sites spamming the referal page that I didnt want my members to go to at the time my vbstats page was full of them.

I sorted it by useing a .htaccess file on the server, you must have mod_rewrite
on and put this in the .htaccess file

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://some-lamer-site.com/
RewriteRule /* http://www.another-site.com/ [R,L]

Replace some-lamer-site.com with the spammer site name that you want to redirect and change the another-site.com to the site they will go to instead of yours, personaly I redirect them to the pop up from hell page.

And so on...for each site you want to block..

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://some-lamer-site.com/
RewriteRule /* http://www.another-site.com/ [R,L]
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://www.spammer_site.com/
RewriteRule /* http://www.internetlastpage.com/ [R,L]