PDA

View Full Version : how odd...



niv
January 22nd, 2002, 12:48
if (($---------~/wired.homeunix.org/) || ($referrer=~/www.stuy.edu/)){
...
}


If I were to load up an image through my pages on wired.homeunix.org, there would be no error because $ENV{'HTTP_REFERER'} would have wired.homeunix.org in it...but when I try loading up a page from my school's page [www.stuy.edu] that happened to have some images on wired.homeunix.org, I get the hotlinking error that I placed myself that probits traffic from sites that are not wired.homeunix.org or www.stuy.edu. Any ideas why? :confused: Same goes for my banner.pl script.

Examples:
[hotlink not detected]
http://wired.homeunix.org/ [watch the banner load and the menu images]
[hotlink detected]
http://wired.homeunix.org/banner.pl
http://wired.homeunix.org/img.pl?menu/home_on.gif

Dusty
January 22nd, 2002, 14:08
All of those links have their images blocked for me, as the referrer being sent by clicking them is "http://www.freewebspace.net/". However, if you reload the page the referrer becomes "http://wired.homeunix.org/" and they all show up. Does your problem lie somewhere in there?

My guess is it's a problem with the referrer being sent (or rather not being sent). I'd suggest for testing purposes instead of returning a "No Hotlinking" image just print out what the script thinks the referrer is. That way, you'd know or at least could narrow down where your problem is.

Side note, you should escape your dots and probably make it case-insensitive:
($---------~/wired\.homeunix\.org/i)||($referrer=~/www\.stuy\.edu/i)

niv
January 22nd, 2002, 14:23
Alright, I'll try that, and I've emailed the administrator of my school's webserver to see if there's anything that's messing with the referer on their end.