HostOnNet Blog

Apache DirectoryIndex

Looking for Linux Server Admin or WordPress Expert? We can help.

 
Apache DirectoryIndex directive allow you to set file name for INDEX page.
 
On a default installation of Apache web server, only index.html will be considered as INDEX document. That is name of your first page should be index.html
 
This is set in apache configuration file (httpd.conf)
 
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
# The index.html.var file (a type-map) is used to deliver content-
# negotiated documents.  The MultiViews Option can be used for the
# same purpose, but it is much slower.
#
DirectoryIndex index.html index.html.var
 
 
If you need index.php or any other file used as extension, you need to change the DirectoryIndex directive.
 
DirectoryIndex index.html index.html.var index.php default.html default.htm default.php
 
Now any of the above extenstion is present in your directory, it will be shown as INDEX for the folder.
 
 
 
 

Posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.