I agree with @TheAlpha's accepted answer, Apache reads the target DirectoryIndex files from left to right, if the first file exists, apche serves it, and if it does not, the next file will serve as an index for the directory. Therefore, if you have the following directive:
DirectoryIndex file1.html file2.html
Apache will serve /file.html as an index, you will need to reorder the files if you want to set / file 2.html as an index
DirectoryIndex file2.html file1.html
You can also set the index file using RewriteRule
RewriteEngine on RewriteRule ^$ /index.html [L]
RewriteRule above will rewrite your homepage in /index.html, the rewriting takes place inside, so http://example.com/ will show you the contents of index.html,
starkeen Feb 25 '17 at 9:35 2017-02-25 09:35
source share