Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
12-21-2006, 10:39 PM #1
- Join Date
- Nov 2006
- Thanked 26 Times in 24 Posts
Blocking/Restricting hyperlinks from certain domains?
Ok, I basically need block ALL visitors coming from certain locations, as the website I work for's population is mainly kids and young teens. So yeah, you see my problem. I would really like to keep them all as safe as possible. One of the main things I'd like to do is block access to it from the 4chan websites, as well as a couple of others. If you know of 4chan, you know why, if not, then assume 4chan is no good. So anyway..
All I really know on this subject is $_SERVER['HTTP_REFERER'], which returns the referral URL, if there is one. BUT, is there a way to block from all locations on a single website? And if so, how?
Thanks in advance!
Last edited by Majoracle; 12-21-2006 at 10:42 PM.
12-22-2006, 01:54 PM #2
What you're looking to do could get pretty complicated and if made too stringent, you may end up throwing the baby out with the bathwater.
First thing to think about is there's no way to block someone who has visited another website.
One way of coming close is to get the referer and log the IP address of the user who came from that site. And then, in the future always block that IP address from viewing your site. But, that's where you can end up blocking legit users too since IPs can change owners frequently. Generally, IP blocking is a bad idea.
Otherwise I, personally, don't know of any slick way of doing this.
If I didn't just "make it worse," show me some love! Hit me with the rep points! :) (The white scales icon on the left)
12-22-2006, 07:48 PM #3
- Join Date
- Sep 2005
- Sydney, Australia
- Thanked 645 Times in 635 Posts
A lot of people have the referrer field turned off in their browser or firewall in order to protect their privacy. There is no way to tell where a visitor came from if they don't want to tell you.