psz1992

我们知道apache的配置文件httpd.conf可以配置网站目录的默认主页。配置文件该部分定义如下:

#DirectoryIndex: sets the file that Apache will serve if a directory is requested.

<IfModule dir_module>
DirectoryIndex index.php index.php3 index.html index.htm
</IfModule>

同理htaccess中的DirectoryIndex 同样可以配置网站目录的默认主页,例如有的服务器默认index.html为主页,而通过DirectoryIndex 则可以设定任意命名的文件为首页。

DirectoryIndex psz.php index.php index.php3 index.html index.htm

服务器的工作流程:首先在目录中找psz.php,有的话就默认为主页,没有的话就继续找下一个,优先顺序为从左往右。

分类:

技术点:

相关文章:

  • 2021-10-21
  • 2022-12-23
  • 2022-12-23
  • 2021-06-08
  • 2022-12-23
  • 2021-10-08
猜你喜欢
  • 2022-12-23
  • 2021-05-07
  • 2021-06-07
  • 2021-10-02
  • 2022-12-23
  • 2021-07-13
  • 2021-06-21
相关资源
相似解决方案