Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to Password Protect images directory


blueantz

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...