How can I change the index listing in a directory?

Article Updated

This article has been consolidated

Directory index configuration is covered in our .htaccess guide.

Short answer: Add DirectoryIndex filename.html to your .htaccess file. Replace filename.html with the file you want displayed when someone visits the directory. You can list multiple files in order of preference. Use Options -Indexes to disable directory browsing.

View .htaccess Guide
  • 498 Users Found This Useful

Was this answer helpful?

Related Articles

Set CORS Header to Allow Access for Any Incoming Domain

Redirect | Updated March 2026 Quick Answer To allow any domain to access your resources,...

How can I change the default page / document?

General | Updated 2026 The default page (also called the directory index) is the file that...

Troubleshooting Cloudflare Errors

General | Updated March 2026 When your site uses Cloudflare as a CDN or proxy, error pages...

html or htm parsed as shtml not working

General | Updated 2026 If you have configured your server to parse .html or .htm files as...

How can I turn off directory indexing?

General | Updated 2026 If visitors can browse a list of files in your directories by going to...



Save 30% on web hosting - Use coupon code Hosting30