WordPress.org

Ready to get started?Download WordPress

Forums

Blocking access to direct link to images. (20 posts)

  1. esfvisions
    Member
    Posted 2 years ago #

    So I'm using wordpress as a photography portfolio website, and I am wondering if there is a way, if you right click on an image and "open in new tab/window" it will bring you directly to that photo url..

    Like, my website has lightroom or w.e it is to show photos when you click on the thumbnail it opens up into a bigger photo. However over the image it will display the direct url so like "www.domainname.com/wp-content/uploads/11/xx/xxxx.jpg" and you can go TO that image and save it..I am wondering if there is away to block access to it, or if you go to the folder it redirects you..

  2. esfvisions
    Member
    Posted 2 years ago #

    Anyone? Maybe what I was trying to say wasn't clear..

    Let me try it again.

    To put it short and simple, if you hover over an image it shows the direct URL to that image, and if you middle click it, it will bring you directly to that image and you can download it right off my server. I've tried everything possible and nothing works, I've googled and couldn't find anything (maybe I'm looking for the wrong thing).

    I included a image so i can better explain what i'm looking to do i guess..

    http://farm7.static.flickr.com/6125/6016228365_f856e2b17d_o.jpg <--Image :)

    So you see the URL on the bottom, i put my mouse over the picture of the valley next to that girls face, and each picture i put my mouse over it'll show the direct URL of that image. If you right click (currently disabled it) or middle click it'll open up that URL in a new tab. I'm wondering if there is a plugin, code, file or something to add in that will block that little blurb or prevent the images from opening up with the middle click.

    Or being able to look at that URL when hovered over and being able to type it in directly.

    Or maybe if possible, you middle click on the file, or directly go to that URL it'll make download like a blank html file, or just redirect you to something else.

    However, the images on the website its self MUST open up in the light box, and remain to be seen on my website. I want the functions of being able to click on the image and it opens up bigger in the website its self.

  3. kostas123
    Member
    Posted 2 years ago #

    Would you like to prevent somebody to "hotlink" your images . If yes , this can be done by configuring the .htaccess file .
    Disabling righ clicking on images can be done through javascript .
    Copy /paste this javascript code into your footer template .

  4. esfvisions
    Member
    Posted 2 years ago #

    Not hotlinking, unless thats what its really called.

    I'm not worried about someone taking an Image and post it on their website or forum,

    I want to block the direct access to the uploads folder?

    I don't want anyone to be able to type in website.com/wp-content/uploads/xx/xx/xxxx.jpg and be able to access the image they type in, and to right click -> save image as. If that makes sense?

  5. esfvisions
    Member
    Posted 2 years ago #

    Right click is disabled, that's not the problem.

    if you go to one of my pages ( http://www.esfvisions.com/personal/landscape/) hover over an image, you can see the direct URL (bottom left firefox 4)and if you type the exact URL you can download the file. I wanna some how either block that URL from showing up, or if you type it in, it will redirect you somewhere.

  6. kostas123
    Member
    Posted 2 years ago #

    A lightbox plug-in may solve it . Tray "lightbox-gallery" , "Simple-lightbox" or "Easy FancyBox"

  7. esfvisions
    Member
    Posted 2 years ago #

    The template already has "prettyPhoto" installed..Unless there are better ones with more options? I'll look into those ones, but knowing my luck i wont have any luck hah

  8. kostas123
    Member
    Posted 2 years ago #

    Or prevent "hotlinking" with .htaccess file (every request to an image-link will redirected to a predefined page ) .

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC]
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yordomain2.com [NC]
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yordomain3.com [NC]
    RewriteRule \.(jpg|jpeg|png|gif)$ http://page-to-redirect [NC,R,L]

    Where yourdomain/yourdomain2/yourdomain3 are the domains that are allowed to hotlink images ( you can add more domains )

  9. esfvisions
    Member
    Posted 2 years ago #

    Hmm i'll have to try that.

    So for example:

    yourdomain.com = url for image 1?
    yourdomain2.com = url for image 2
    etc
    etc

    and where do i put this .htaccess? In the root folder? or a different one?

  10. esfvisions
    Member
    Posted 2 years ago #

    so the .htaccess code works..it'll redirect, but no images will show up. All are red x's

  11. MickeyRoush
    Member
    Posted 2 years ago #

    You could disable right clicking, etc. with javascript, but if they really want the picture they can view source or view information via the browser to retrieve it. Basically, anything that the browser sees can be retrieved. You can make it harder to retrieve them and/or use watermarks on your images.

    Check out this link for other ways:
    http://www.webresourcesdepot.com/10-ways-to-protect-images-from-being-stolen/

  12. esfvisions
    Member
    Posted 2 years ago #

    So pretty much what i wanna do is impossible? I figured as much, my only question is how does Flickr do it? Im assuming since its all written on different source code that's how?

    Bleh, I was trying avoid watermarks, and low res images..I guess thats the only thing i could do.

  13. There's no way to keep people from hitting up your images by the full URL if they have it. That's just a fact of life. AND even if you do, someone can screen scrap the image, so the only real protection is (a) don't put it online and (b) watermark.

  14. esfvisions
    Member
    Posted 2 years ago #

    Yeah i figure..However, i just wonder how Smug-mug makes it work..you rollover a clickable image, and it doesn't list the direct url. I'm assuming its cause of a different code source then wordpress is? But couldn't something be implemented to 'protect' the uploads folder?

  15. They're generating the image via flash, I believe, but ...

    You can get the direct images there on a lot of images, just by right clicking on them or viewing source.

  16. MickeyRoush
    Member
    Posted 2 years ago #

    I figured as much, my only question is how does Flickr do it? Im assuming since its all written on different source code that's how?

    I'm not sure how Flickr does it, but you can retrieve their images by viewing page info, selecting media and browsing through the images. Then just select Save As. They can try and keep the inexperienced users from getting the image, but most users know that anything the browser sees, they can retrieve. (Example for Flickr using Firefox. Right click the image. Select View Image Info. A a window will appear where you can select the image and Save As...)

    You could disable right click, but you may end up irritating some of your users.

    But couldn't something be implemented to 'protect' the uploads folder?

    You can protect you uploads folder, but again you have to make sure the browser can retrieve the image. So anything the browser sees, so can the user retrieve. You can make it difficult to retrieve, but it's still retrievable.

  17. kostas123
    Member
    Posted 2 years ago #

    Some simple notes :
    1) .htaccess provides a way to make configuration changes on a per-directory basis on Apache web-servers . Simply , it controls the server's behavior on-the-fly !!!
    2)Each time Apache receives a request, it reads this configuration file (if available) and adopt all the configurations (directives) .
    3)Can we deny access to some recources on the server ?? Definitely Yes !!!

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC]
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yordomain2.com [NC]
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yordomain3.com [NC]
    RewriteRule \.(jpg|jpeg|png|gif)$ http://page-to-redirect [NC,R,L]

    Let me explain the code :

    RewriteRule \.(jpg|jpeg|png|gif)$ http://page-to-redirect [NC,R,L]

    All request for this type of content will be redirected to this predefined URL .
    ############################################

    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC]
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yordomain2.com [NC]
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yordomain3.com [NC]

    Requests made from these domains are allowed to access the specified content . We have to define at least our domain , so that our web-pages can access these recources , otherwise requests from our web-pages (for this type of content) will also redirected .

  18. kostas123 - That's just hotlink code. If I can FIND the url of your image, I can still access the image because I'll be doing so FROM your server :/

  19. esfvisions
    Member
    Posted 2 years ago #

    I'm not sure how Flickr does it, but you can retrieve their images by viewing page info, selecting media and browsing through the images. Then just select Save As. They can try and keep the inexperienced users from getting the image, but most users know that anything the browser sees, they can retrieve. (Example for Flickr using Firefox. Right click the image. Select View Image Info. A a window will appear where you can select the image and Save As...)

    Is there anyway to do that in wordpress/lightbox? I'm coming to terms that what i want wont fully happen unless i go with flash or something..If there is some extra protection that's all I'd want.

    You can protect you uploads folder, but again you have to make sure the browser can retrieve the image. So anything the browser sees, so can the user retrieve. You can make it difficult to retrieve, but it's still retrievable.

    Yea after trying some coding, and what not, it on;y makes more headaches to view the images on the website.

  20. MickeyRoush
    Member
    Posted 2 years ago #

    You could try one of these plugins. You might even want to contact one of those developers to see if they can incorporate the same code that Fickr uses. From looking at the reviews, these may not work with lightbox.

    http://wordpress.org/extend/plugins/wp-protect/
    http://wordpress.org/extend/plugins/blog-protector/
    http://wordpress.org/extend/plugins/wp-copyprotect/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.