DirectoryIndex Priority

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:

1
DirectoryIndex index.php

Add a new filename

To add a new filename to the list of index pages that Apache recognizes, perform the following steps:

  1. Click Add.
  2. Enter the name of the index file that you wish to add (for example, index.nick).
  3. Click OK.
  4. Click Save.
  5. 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 the root user.

Remove a filename

To remove filenames from the list of index pages that Apache recognizes, perform the following steps:

  1. In the available menu, select the index file or files that you wish to remove.
  2. Click Remove.
  3. Click Save.
  4. 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 the root user.

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:

  1. In the available menu, select the index file that you wish to move up or down in priority.
  2. Click Move Up or Move Down to change the filename’s order.
    • For example, if you want index.html to appear instead of index.php, select index.html from the menu and click Move Up until index.html is higher in the menu than the index.php entry.
  3. Click Save.
  4. 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 the root user.