Set Directory Index File Priority — Step-by-Step Guide

Set Directory Index File Priority — Step-by-Step Guide

Overview

When visitors open a directory without specifying a file, the server uses the first matching filename as the index (e.g., index.html). This interface lets you control which filenames the server looks for and prioritize their order.

Once saved, the system updates your Apache configuration file (typically /usr/local/apache/conf/httpd.conf) with a directive like:

DirectoryIndex index.php

Add a New Filename

  1. Click the Add button.
  2. Enter the filename you want Apache to recognize (e.g., index.custom).
  3. Click OK, then Save.
  4. Select Rebuild Configuration and Restart Apache to apply the change.
  5. You can also restart Apache manually via command line—for example:

    /scripts/restartsrv_httpd

Remove a Filename

  1. Select the filename(s) you want to remove.
  2. Click Remove.
  3. Click Save.
  4. Rebuild configuration and restart Apache to implement changes.

Reorder Filename Priority

Filenames at the top of the list have higher priority. To change the order:

  1. Select a filename you want to move.
  2. Click Move Up or Move Down as needed.
  3. Click Save.
  4. Rebuild configuration and restart Apache to apply the new order.

For example, to display index.html first, move it above index.php in the list.

Summary

  • Use this interface to manage which index filenames Apache prioritizes.
  • Add, remove, or reorder filenames easily.
  • Always rebuild configuration and restart Apache to apply changes.

We are a shared license provider; if you need a cPanel shared license at a cheap price, you can buy it from us.

case studies

See More Case Studies