Print Topic - Archive
E-Blah Community / E-Blah 10.x Mods / Stop users hotlinking to uploads.
Posted by: iCONICA, June 27, 2008, 5:29pm
This is a tiny mod so people can stop other sites stealing their bandwidth via hot linking to their files.
I recently had a user upload a 10MB audio track to my "music" section he wrote a quick post to make it look legit, I then found he first clicked the download link to download it then when your taken to the download page built into the E-Blah software, there is a link to "click after 5 seconds if your download does not begin automatically" that "click here" is the file link itself, which he put in a link on another site for download. Stealing my bandwidth without sending me any visitors...
Anyway this can be fixed by uploading a .htaccess file using mod_rewrite to your uploads folder.
I've already added the most common file extensions. It will block them from being accessed by any other referrer other than your own, Simply change i-conica.net to your own url.
don't include www. that way it will cover any sub domain of yours also, allowing them to link but not other sites.
For some reason it won't work correctly with images, It blocks them but because E-Blah resizes image it blocks them from showing. No idea why...
mod_rewrite can be confusing, i've tried, tried, tried again and failed. I eventually figured it out and tested it and it works, I'm posting this here in case anyone else has had the same problem. It is not version specific, will work with any eblah version.
Hope someone finds this useful...
Posted by: Martin, June 28, 2008, 12:20am; Reply: 1
Can't download it for some reason. Error says "you don't have permission to download this file" ????
Justin, what may be causing this ?
Posted by: iCONICA, June 28, 2008, 1:16am; Reply: 2
Ah.... That would be the full stop before the htaccess file name, Sorry about that.
I'll re upload.
Delete the above attachment.
I've renamed the .htaccess file "htaccess.txt" Just changed the file name back after unzipping. :)
Posted by: iCONICA, June 28, 2008, 1:30am; Reply: 3
To add, Little description I missed...
Usually mod_rewrite will replace a requested image with an alternate "Please do not hotlink to my files" image, That doesn't really help...
This one, will redirect ANY request for any of the listed file extensions from a referrer other than your own domain, to the home page of your site.
The .htaccess file will be effective against any directory below it. To cover your entire domain, place in your root. (the highest level you have access to)
Example...
Try clicking the below link, That is a real link that is accessed by my download page. To you, it will simply take you to my home page.
http://i-conica.net/download/software/image-video-editing/photoshop/ADBEPHSPCS3_WWE.exe
Posted by: tron, June 29, 2008, 12:29am; Reply: 4
I could still right click and 'save target as..' or is doing that behind the scope of the .htaccess?
Posted by: Martin, June 29, 2008, 3:56am; Reply: 5
This is to stop people linking directly to your images/downloads and stealing your bandwidth.
You can run scripts to disable Right Click but it isn't worth it, they are just a deterent, if somebody wants your image they will get it.
Posted by: iCONICA, June 29, 2008, 7:47am; Reply: 6
@ tron, The point of using this is to stop people linking to your files from their site, not yours. it doesn't stop downloading from your site, it simply redirects the user to your home page only when files are linked to from other sites. when the referrer isn't your domain.
:)
You can use JavaScript to prevent right clicking, but as martin pointed out, its just annoying rather than protecting anything...
Posted by: tron, June 29, 2008, 2:23pm; Reply: 7
Thanks for the extra clarification! :)
Print page generated: November 20, 2008, 6:10pm