4images Forum & Community

4images Issues / Ausgaben => Installation, Update & Configuration => Topic started by: arindra on April 26, 2005, 04:22:53 PM

Title: media directory restrictions
Post by: arindra on April 26, 2005, 04:22:53 PM
hey
how can we prevent users ( Guests ) from being able to simply copy paste a image url from the thumbnail link and then change the " thumbnail" to "media" and thus view the image , even without loggin in ?
Title: Re: media directory restrictions
Post by: Chris on April 26, 2005, 06:03:45 PM
Search the forums for pic security

This subject has been covered in great detail
Title: Re: media directory restrictions
Post by: arindra on May 05, 2005, 03:35:47 PM
Hi guys ,
I have managed to find my solution , and this is the code i am using is below . hopefully this will help others . Put these codes in a .htaccess file under every directory u have under the media directory and upload the file .

Code: [Select]
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mysite.com/gallery/.*.php(/)?.*$     [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp)$ http://www.mysite.com/gallery/ [R,NC]

What this will do :

this will allow you to prevent other sites from hotlinking your images . anyone trying to hotlink your images will now get get nothing .
Not just hotlinking from other site , my problem was : anyone copying the shortcut of the thumbnail files and changign the thumbnails to media , could easily be able to view the full images by Being a GUEST even !! . This will redirect those users to the homepage of your gallery ( u may change it to what u want ) .

Cheers
Title: Re: media directory restrictions
Post by: V@no on May 05, 2005, 03:47:08 PM
there is one issue with such method:
people with "Interent privacy" software which blocks referal page would not be able see the images on your site.
Title: Re: media directory restrictions
Post by: arindra on May 05, 2005, 04:16:45 PM
internet privacy software such as net nanny ?
Title: Re: media directory restrictions
Post by: arindra on May 05, 2005, 04:19:43 PM
if so , i am cool with it , coz ... i dont expect them to be much ... but on the other hand , it solves much of the problem in a much simpler way than the other codes anc changes to go through in the other Pic Security thread  :mrgreen:
Title: Re: media directory restrictions
Post by: Chris on May 05, 2005, 07:06:02 PM
Norton Internet Security is another and any other software or browser setting that disables sending referer information
Title: Re: media directory restrictions
Post by: tippy on October 26, 2008, 05:39:34 PM
Hi guys ,
I have managed to find my solution , and this is the code i am using is below . hopefully this will help others . Put these codes in a .htaccess file under every directory u have under the media directory and upload the file .

Code: [Select]
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mysite.com/gallery/.*.php(/)?.*$     [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp)$ http://www.mysite.com/gallery/ [R,NC]

What this will do :

this will allow you to prevent other sites from hotlinking your images . anyone trying to hotlink your images will now get get nothing .
Not just hotlinking from other site , my problem was : anyone copying the shortcut of the thumbnail files and changign the thumbnails to media , could easily be able to view the full images by Being a GUEST even !! . This will redirect those users to the homepage of your gallery ( u may change it to what u want ) .

Cheers

Sorry for dragging this back up to the top but I was trying to add this to my site to stop people from downloading my wmv/avi files directly from my site via viewing the page source and copying/pasting the direct data link.

Maybe Im not doing it right, my site is on an add-on domain, for example blah.hello.com, my gallery is installed in a sub folder blah/gallery.

I add this .htaccess file to all my directories under my media folder but when I try to watch a video it loads and just says ready, but the file doesnt play?

Anyone have any advice on how to make this code work?

Thanks,

Mike
ver : 1.7.4
Title: Re: media directory restrictions
Post by: V@no on October 26, 2008, 07:56:10 PM
Windows media player doesn't send the referrer when requesting the video file.
Title: Re: media directory restrictions
Post by: tippy on October 27, 2008, 09:34:40 PM
Thanks for the quick reply V@no, much appreciated.

I did read through some of the posting in the "Pic Security" thread but from what I read there isnt a way to protect wmv/avi files unless I read it wrong, Im gonna go read the entire thread again.

I have to figure out some way to stop these people from directly accessing my /data/media files...

Thanks again,

Mike