Ubuntu 14.04上的Apache2不会加载index.php

时间:2014-11-06 23:03:23

标签: apache .htaccess ubuntu-14.04

使用以下帖子:

我已将/etc/apache2/apache2.conf文件更改为以下内容:

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory

我已将文件/var/www/html/.htaccess创建为以下内容:

DirectoryIndex Index.php index.php Index.html index.html Index.htm index.htm

当我访问我的网站时,默认页面仍然是(It Works!)index.html文件。

如何配置Apache以优先考虑index.php?

1 个答案:

答案 0 :(得分:1)

您的DocumentRoot /var/www//var/www/html/(后者是您说的.htaccess文件的位置)??

如果.htaccess/var/www/html/之内,我猜你需要将Apache配置更新为:

<Directory /var/www/html/>