Site5 - Built For Designers & Developers MENU
Home  ›  Apache  ›  Apache: How to turn off directory browsing

Apache: How to turn off directory browsing


You can use either of the below commands to stop directory browsing, just add either one to your .htaccess file.

Options -Indexes


Options None

This is useful if you have a big list of files in a directory with no index.html file and you don’t want visitors to be able to browse through all of those. I’m not sure why there are two commands available for this, but either work so enjoy :).

Still have a question? Or need help?
If you need technical support with your account, please email us or chat live with a representative.


  • I want don’t to index robots.txt, sitemap.xml and some specific pages. Will you tell me, how can I do it through htaccess? Any suggestion will be appreciated; thanks in advance.

  • I got the solution, just need to know whether it’s right or not. What’s your opinion about this.

    Header set X-Robots-Tag “noindex”

    Header set X-Robots-Tag “noindex”

    • That may work, yes. The best way to test this would be to add it to your .htaccess file and test the site.

  • I think it comes by-default to not to index robots.txt in .htacess files. By reading this I have added all noindex to my robots.txt.

Money Back Guarantees