How to disallow accessing jpg or png files directly??

bebebunny

Joined: 2013-04-21
Posts: 23
Posted: Mon, 2014-02-03 22:16

I want to disable visitor from accessing direct files like jpg or png? i have edited album permission but only protecting the album, not individual image.

eg: website.com/gallery/var/resizes/Albums3/image4.jpeg

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Sat, 2014-02-15 07:48

htaccess is what you're after, but it'll have consequences that you may not want. (e.g. search engines wouldn't be able to index those files unless you add several lines of code to allow them special access; social media might not be able to display those little images next to links shared from your site; etc, etc.)

Do an internet search on hotlinking and it'll show you how to format the htaccess.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2014-02-15 17:48

If you have protected the album then you should _NOT_ be able to access the image directly.
FAQ: Are my photos secure? They're right there on my website!

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team