Why does index.html have priority over index.php?

后端 未结 5 530
被撕碎了的回忆
被撕碎了的回忆 2020-11-30 05:48

I have a website on a server. The homepage is example.com/index.php .

OK, I uploaded an index.html named file to the server (the root dir) and when I typed in my sit

5条回答
  •  渐次进展
    2020-11-30 06:34

    It really depends on the Server you're using. This is a matter of configuration. It's not that there's any advantage from using html vs php filetype.

    You could say that the .html variation takes precedence due to the fact that it's the most basic web format.

    If you're using Apache, just check the default .htaccess setup:

    DirectoryIndex index.html index.shtml index.php index.htm default.html Default.htm default.html Default.html default.shtml Default.shtml page1.html index.pl index.cgi index.php3 index.phtml home.htm home.html home.shtml index.wml
    

    You can edit that and make it fit your needs.

提交回复
热议问题