Forum Moderators: Robert Charlton & goodroi
[edited by: tedster at 4:07 am (utc) on Apr 29, 2011]
[edit reason] un-hide the example URLs [/edit]
instead of doing a referer check and displaying anything I want anyone visiting any .jpg url on MY site directly to end up on the index page instead.
Ironically when you put hotlink protection in people tend to link directly to the image. Just like people rewrite non-www to www I want to rewrite all *.jpg to example.com (example).
If you visit this url [webmasterworld.com...] you end up here [webmasterworld.com...]
Uhm, no, I get the logo. Double-checked in another browser to make sure it wasn't pulling something out of my cache. Also happens if I put it as a link in a free-standing html file and open in yet a third browser.
To me, hotlinking is linking directly to the image
But even if that is what we're discussing, I don't know how the server can tell the difference, except by seeing a request for the HTML file just before the image request.
And the referrer reference is unreliable.
And the referrer reference is unreliable.
#2 There are no legitimate user-agents that send a blank referrer when requesting image files associated with the page you're currently on. If there are, you've got a problem.
If so, how would one prevent it?
There are no legitimate user-agents that send a blank referrer when requesting image files associated with the page you're currently on. If there are, you've got a problem.
<img src="http://example.com/image.jpg" onload="alert('image is hot-linked')" />
Worrying about no referrer is about like worrying about people with JavaScript off for privacy ... You miss all of them with your alert,
<iframe src="http://example.com/image.jpg" width="300" height="300"></iframe> You also believe that because you output some html along with headers, the browser won't execute it.
Hot link broken
for which there are frame busters
I don't know all the details but I have seen SEs doing visits on pages with hidden UAs and blank referrers.
Yes although the visitor won't see anything broken.
But there are methods with frame busters busters to counter frame busters (204 header?).
Apart of the fact anyone could modify the referrer...
...another reason I don't trust cross-referencing the referrer is because of SEO.
I don't know what duplicated content this may cause.
It's just too risky.
You now have to go in and add exceptions for search engines if you can detect them.
The 'perfect' solution is to not put your images on the Internet
Then don't use it, but don't let your lack of understanding and fear be the guiding force for others.
If someone exposes your images as links now SEs will follow, your htaccess will now invoke the the-php-file.php which in turn will return html code with a 200 OK.
For a person to NOT send a referrer header, usually they have to WORK to keep it from being sent, which is not something most people care to do.
You would NOT break the images for bookmark clicks or type-ins for the actual pages for people sending referrer information either, because their browser would send the page as the referrer for the image request ...
I meant people going directly to the image. I actually have a couple of those among my bookmarks.