Valid for versions 82 through the latest version
Version:
82
Overview
Visitors see the index page by default when they access a directory (for example, index.html
). The DirectoryIndex Priority interface allows you to specify the filenames that Apache recognizes and displays as index pages. You can also set the priority in which Apache selects an index page if more than one of these filenames appears in a directory.
To perform these actions, the system modifies the /usr/local/apache/conf/httpd.conf
file. For example, if you configure the system to display the index.php
file, the system adds the following line:
|
|
Add a new filename
To add a new filename to the list of index pages that Apache recognizes, perform the following steps:
- Click Add.
- Enter the name of the index file that you wish to add (for example,
index.nick
). - Click OK.
- Click Save.
- Click Rebuild Configuration and Restart Apache to configure Apache to use the new DirectoryIndex settings.
- To restart Apache later, use WHM’s HTTP Server (Apache) interface (WHM >> Home >> Restart Services >> HTTP Server (Apache)) or run the
/scripts/restartsrv_httpd
command via SSH as theroot
user.
- To restart Apache later, use WHM’s HTTP Server (Apache) interface (WHM >> Home >> Restart Services >> HTTP Server (Apache)) or run the
Remove a filename
To remove filenames from the list of index pages that Apache recognizes, perform the following steps:
- In the available menu, select the index file or files that you wish to remove.
- Click Remove.
- Click Save.
- Click Rebuild Configuration and Restart Apache to configure Apache to use the new DirectoryIndex settings.
- To restart Apache later, use WHM’s HTTP Server (Apache) interface (WHM >> Home >> Restart Services >> HTTP Server (Apache)) or run the
/scripts/restartsrv_httpd
command via SSH as theroot
user.
- To restart Apache later, use WHM’s HTTP Server (Apache) interface (WHM >> Home >> Restart Services >> HTTP Server (Apache)) or run the
Set index page name priority
Filenames that the interface displays higher in the menu have a higher priority than names that are lower in the menu.
To reorder the priority of index page names that Apache recognizes, perform the following steps:
- In the available menu, select the index file that you wish to move up or down in priority.
- Click Move Up or Move Down to change the filename’s order.
- For example, if you want
index.html
to appear instead ofindex.php
, selectindex.html
from the menu and click Move Up untilindex.html
is higher in the menu than theindex.php
entry.
- For example, if you want
- Click Save.
- Click Rebuild Configuration and Restart Apache to configure Apache to use the new DirectoryIndex settings.
- To restart Apache later, use WHM’s HTTP Server (Apache) interface (WHM >> Home >> Restart Services >> HTTP Server (Apache)) or run the
/scripts/restartsrv_httpd
command via SSH as theroot
user.
- To restart Apache later, use WHM’s HTTP Server (Apache) interface (WHM >> Home >> Restart Services >> HTTP Server (Apache)) or run the