DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Chara has posted 50 posts at DZone. View Full User Profile

Different Directory Index Page in .htaccess

02.03.2014
| 1406 views |
  • submit to reddit
# Source: http://www.apphp.com/index.php?snippet=htaccess-different-directory-index-page

# Sample 1: 
DirectoryIndex index2.html
 
# Sample 2: 
DirectoryIndex index2.php

We know that normally index.html or index.php is the default page for many servers, when visitor types a directory without specifying a file name. You can change this rule with .htaccess: