cancel
Showing results for 
Search instead for 
Did you mean: 

.htaccess to stop index pages

N/A

.htaccess to stop index pages

Is there a way of using .htaccess to prevent an index page appearing when no index.htm / default.htm file exists in a folder?

I've raised this as a Contact Us ticket and was advised to post the question in here.

Any help appreciated.

Wobbler
3 REPLIES
N/A

.htaccess to stop index pages

An entry in your .htaccess file saying "Options -Indexes" should do the trick.

HTH,

Tony
N/A

.htaccess to stop index pages

So what would I need to add to the .htaccess file? Shockedops:
N/A

.htaccess to stop index pages

Just create a file called .htaccess (the dot at the front is important) in the directory for which you don't want indexes to be automatically created. The contents of that file should literally just be:
Options -Indexes
The effect will work on any subdirectories in that tree unless you specifically enable it - so if you put the .htaccess file in your /htdocs/ directory then no directory listings will be possible on your site.

HTH,

Tony