Sunday, June 26, 2016

APACHE - Disable directory browsing


  • otoworkz
    • upload
      • images
      • sound

Let say we have a directory structure like above, and we want to block any direct access to the upload folder the child folder (images, sound). So how? follow these instruction:

  1. Create .htaccess file with the following content:
    Options -Indexes
  2. Put it under upload folder.
  3. Change file permission to 755:
    sudo chmod 755 .htaccess
  4.  Restart the Apache and done!

* if still not work, try to enable mod_rewrite module on Apache httpd.conf file.

No comments:

Post a Comment