To display or change the default page that Apache serves when a client requests a directory on the web server, you can use the DirectoryIndex
directive in the Apache HTTPD configuration file.
The DirectoryIndex
directive specifies the file or files that Apache will serve as the default page when a client requests a directory on the web server. By default, Apache will look for a file named index.html
in the requested directory and serve it as the default page.
To specify a different default page, you can add a DirectoryIndex
directive to the Apache HTTPD configuration file, as shown below:
DirectoryIndex <default_page>
where <default_page>
is the name of the file that you want to serve as the default page for directory requests. You can specify multiple files, separated by spaces, and Apache will try to serve the first file that exists in the requested directory.
For example, to make Apache serve a file named default.html
as the default page for directory requests, you can add the following DirectoryIndex
directive to the Apache HTTPD configuration file:
DirectoryIndex default.html
Keep in mind that the exact syntax and location of the DirectoryIndex
directive may vary depending on your specific Apache installation and configuration. It is always a good idea to refer to the official Apache documentation for detailed instructions and further information.