我的 .htaccess 文件中有以下行:
DirectoryIndex index.html index.php
每次我转到index.php时,它都会带我到index.html。是否可以同时允许两者,但将 index.html 保留为访问 www.domain.com 的用户的默认值?
默认情况下,DirectoryIndex 设置为:
DirectoryIndex index.html index.htm default.htm index.php index.php3 index.phtml index.php5 index.shtml mwindex.phtml
Apache 将按顺序查找上述每个文件,并在访问者仅请求目录时提供找到的第一个文件。如果网络服务器在当前目录中找不到与 DirectoryIndex 指令中的名称匹配的文件,则会向浏览器显示目录列表,显示当前目录中的所有文件。
顺序应该是DirectoryIndex index.html index.php
// 默认为index.html
参考: Here http://support.modwest.com/content/1/147/en/how-can-i-show-a-default-page-other-than-indexhtml.html.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)