Hello -
this is due to an Apache Module and the Directive values it is configured with
The Module is dir_module.
Look for this (probably in your \xampp\apache\conf\httpd.conf file):
- Code: Select all
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex index.php index.pl index.cgi index.asp index.shtml index.html index.htm \
default.php default.pl default.cgi default.asp default.shtml default.html default.htm \
home.php home.pl home.cgi home.asp home.shtml home.html home.htm
</IfModule>
This tells Apache what file to serve if a Directory Index is requested (that is what happens when you do not specify a specific page by its URL.)
Since index.php comes before index.html, the index.php (which is a redirect to /htdocs/xampp/index.php) is served. Change the DirectoryIndex line so index.html is BEFORE index.php, save the file and restart Apache.
- Code: Select all
DirectoryIndex index.html index.php index.pl index.cgi index.asp index.shtml index.htm \
Now Apache should serve your index.html file when you point your browser to
http://localhost/ You can also change that directive with a .htaccess file on a directory by directory basis, or by specifying the values in a 'Directory' directive. Apache usually has many ways to do the same thing.
http://httpd.apache.org/docs/2.2/mod/mod_dir.htmlhttps://httpd.apache.org/docs/current/m ... #directoryYou could also delete \xampp\htdocs\index.php OR rename it to a different value. BUT then you would not know why this works...
Good Luck