How to set default page in Apache?

Apache web server is probably the most used web server across platforms including different Linux distributions and Windows.

The web server is used to deliver web content and can serve many queries at once.

To make the necessary changes you need to modify the DocumentRoot directive of the web server.

This is the directory from which Apache will read the contents that the visitor will access over browser. Or in other words, this is the directory that forms the tree of directories that will be accessible over web.

Apache default page is very easy to configure, we just need to configure Apache conf file.

Step 1: Follow the below path

/etc/httpd/conf/httpd.conf

Step 2: Make the following changes in httpd.conf file.

Change index.html or index.php to whatever default page you want.

# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.html index.php
</IfModule>

Once you’ve modified the document root save the file.

Step 3: Now restart the Apache by using below Command:

(For systemD)
# systemctl restart apache

(For Sysvinit)
# service httpd restart

Build Your Website with Hostiko

From professional business to enterprise, we’ve got you covered!

Copyright ©2026 QualiSpace. All rights reserved.

A Platform

QualiSpace
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.