If, like me, you like to play around with your web site – occasionally you’ll accidentally break it, as I have. This latest time, I disabled the directory browsing on my site to increase security, but the way that I tried to do it through the cpanel index manager, left my whole site inaccessible.

So that I remember next time I do this… I’ve written the instructions down here.

Disable directory browsing using .htaccess:-

  • Open your .htacces file
  • Look for Options Indexes
  • If Options Indexes exists modify it to Options -Indexes / otherwise,  add Options -Indexes as a new line
  • The directory browsing feature should be disabled now

If, like me you try and do it through the cpanel index manager, then just delete your .htaccess file (or rename it if you don’t want to lose all of its content), and then start again. But, once you do disable directory browsing, visitors will not be able to browse your directories by accessing the directory directly.