繁体   English   中英

更改 dir.conf 文件中的文件首选项后,apache 服务器提供 index.html 而不是 index.php

[英]apache server serving index.html instead of index.php, after changing the file preference inside the dir.conf file

我更改了 dir.conf 文件中的文件首选项:

$sudo nano /etc/apache2/mods-enabled/dir.conf

<IfModule mod_dir.c>
    DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
</IfModule>

这意味着 index.php 将获得首选,对吗?

/var/www/html我有两个文件,即index.html 和index.php。 但是当我在浏览器中访问我的 ip_address 时,正在提供 index.html 而不是 index.php。 我错过了什么吗?

更改您的dir.conf文件:

<IfModule mod_dir.c>
        DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM