Default file for Apache localhost

11,444

Solution 1

Apache will not trigger HTTP redirections unless you instruct it to do so.

My advice is that you open your favourite text editor and search for the class string in the following locations:

  • *.conf files inside the Apache installation directory.
  • .htaccess files inside your HTML directores.

If that fails to find anything, you could also search for header() calls in your *.php code.

Solution 2

Find the DirectoryIndex directive in your Apache configuration file (httpd.conf) or add it to a .htaccess file and change it to look like this if you want to limit your default index file to just index.html:

DirectoryIndex index.html

You can also include more resources and they will be used in the order given, e.g

DirectoryIndex index.html index.php

would display the index.html file first if both index.html and index.php existed.

Don't forget to restart Apache if you made the change to the httpd.conf file.

Look at the mod_dir documentation for more information.

Share:
11,444
Amal Antony
Author by

Amal Antony

Updated on July 15, 2022

Comments