![](/img/trans.png)
[英]How to make Apache serve index.php instead of index.html?
[英]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.