Hotlinking vs. direct linking

Started by Alps, October 17, 2010, 12:22:00 AM

Previous topic - Next topic

Alps

Quote from: AlpsROADS on October 17, 2010, 12:20:23 AM
Figured it out - it's a side effect of disabling hotlinking.  Unfortunately, it does not appear that I can disable hotlinking (i.e. showing my images directly) while preserving access via direct linking.  It's an all or nothing proposition.  If someone can tell me otherwise, I'd be appreciative.

Can someone tell me if there is any way to keep hotlinking disabled but direct linking enabled?
Inserting an image here: should not work but http://www.alpsroads.net/roads/alps.jpg should, ideally.


NJRoadfan

You have to create a .htaccess file on your server to restrict hotlinking.

Alps

That's what I have right now, which is why "Inserting an image here" does not work.  It's the direct linking part that I don't know about.

agentsteel53

alas, it appears to be non-doable without help from the client.  The server simply *cannot* tell the difference between a "HTTP GET foo.jpg referer=someothersite.com" when it's a direct link, and an identical "HTTP GET foo.jpg referer=someothersite.com" when it's a hotlink.

the browser, however, can.  If it's an IMG tag that spawned the GET, it's a hotlink.  If it's the user clicking on an A, it is a direct link.  In the case of a server returning 403 on an image, the browser should immediately check to see if the A tag is being used, and in that case resend the request with the referer stripped, spoofing a URL typed directly into a browser's address bar.  

It's an easy-as-Hell solution and I can't believe no browser has implemented it yet.

(if a browser wants to not play nice, it would strip the referer in the case of an IMG as well, thereby bypassing the hotlinking controls of the server.  But that wouldn't be nice.)
live from sunny San Diego.

http://shields.aaroads.com

jake@aaroads.com

Alps

Quote from: agentsteel53 on October 18, 2010, 07:18:08 PM

(if a browser wants to not play nice, it would strip the referer in the case of an IMG as well, thereby bypassing the hotlinking controls of the server.  But that wouldn't be nice.)
Egads man, genius!  I want one.

Scott5114

I'm kind of surprised nobody has done a Firefox extension to do that yet.
uncontrollable freak sardine salad chef



Opinions expressed here on belong solely to the poster and do not represent or reflect the opinions or beliefs of AARoads, its creators and/or associates.