blueantz Posted December 18, 2008 Share Posted December 18, 2008 Is there a way to enable password protect on images folder without preventing display of any image inside that directory? All I want to do is to prevent people from viewing contents of /images folder directly. If someone enters http://<my-domain-name.com>/images, they should receive some kind of message saying something like "Forbidden. You don't have permission to access /images/ on this server." I've tried enabling password protect for the images directory, but it prevented any image from displaying unless you entered password. Link to comment Share on other sites More sharing options...
Kanie Posted December 18, 2008 Share Posted December 18, 2008 Add this to the .htaccess file in the main catalogue directory. Options All -Indexes This will prevent everyone from browsing the indexes of any directories without default pages. Another method is to create a (typically blank) index.html or index.php page and put that in the images directory. Link to comment Share on other sites More sharing options...
danielcompton Posted December 19, 2008 Share Posted December 19, 2008 just create a blank text file and save it as .htaccess copy that into the images folder. It prevents browsing of the folder, but allows direct URL viewing if the person knows the image name/path Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.