Reply
Prevent hotlinking and direct requests
Old 05-26-2007, 08:15 PM Prevent hotlinking and direct requests
delighted's Avatar
Super Talker

Posts: 147
Not sure if this is the right forum, but is it possible to enable a image to be viewed only if it's linked from within my domain, and not if it's linked from someone else's (hotlinked) or directly requested?

Thanks!
__________________
Prontofiles- upload and share 500 MB files. No registration.
delighted is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 05-26-2007, 09:15 PM Re: Prevent hotlinking and direct requests
Average Talker

Posts: 22
Check out this website: http://altlab.com/htaccess_tutorial.html

Hope this helps!
FuZion is offline
Reply With Quote
View Public Profile
 
Old 05-26-2007, 09:56 PM Re: Prevent hotlinking and direct requests
delighted's Avatar
Super Talker

Posts: 147
Thank you, this was informational. It describes how to stop hotlinking, but there still is a problem with people doing direct requests to the image. This is where I guess PHP could be useful.
__________________
Prontofiles- upload and share 500 MB files. No registration.
delighted is offline
Reply With Quote
View Public Profile
 
Old 05-28-2007, 01:02 AM Re: Prevent hotlinking and direct requests
Novice Talker

Posts: 10
Name: Jossielyn Lucero
Hi!

Why not disable the right click function or encrypt the site to prevent them from seeing the image link?
prtt75 is offline
Reply With Quote
View Public Profile
 
Old 05-28-2007, 05:03 AM Re: Prevent hotlinking and direct requests
mtishetsky's Avatar
King Spam Talker

Posts: 1,063
Name: Mike
Location: Mataro, Spain
prtt75, disabled right click is the most idiotic protection I've ever seen.
delighted, add some letters to your .htaccess to prevent sending images if the referer is not yours or empty:
Code:
RewriteCond %{HTTP_REFERER} !(^www\.)?mydomain.com
RewriteRule ^images/(.*)\.jpg http://www.mydomain.com/images/hotlinked.jpg [L]
At my site urls are constructed in such a way that I can reproduce the name of the corresponding page from the name of requsted file and if the referer is empty or not mine then redirect the request to the page instead of the file. For example try to download this file: http://www.onsmartphone.com/themes/s...heme-10261.zip. You will get redirected to http://www.onsmartphone.com/download...dy-theme-10261. Next, if you click the link from that page you will download the ZIP file quite fine.
__________________
Free Mobile Phone Themes

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 05-28-2007, 07:49 PM Re: Prevent hotlinking and direct requests
delighted's Avatar
Super Talker

Posts: 147
Thanks a lot! This is just what I'm looking for.
__________________
Prontofiles- upload and share 500 MB files. No registration.
delighted is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Prevent hotlinking and direct requests
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12715 seconds with 12 queries