Apache服务器没有读取.htaccess文件

时间:2015-01-27 19:45:40

标签: apache .htaccess

注意:我搜索了很长时间,没有取得任何成功结果。

大家好,我正在尝试建立一个网站,除了我的.htaccess文件外,一切似乎都有效。经过一些调试后,我注意到它甚至没有被读取(当我在.htaccess中添加随机内容时没有触发内部错误)

我已经从 apache 中找到了需要在配置内部进行更改的内容。我不确定是否正确保存了正确的内容。

Htaccess内容:

php_flag display_errors on
php_value error_reporting 9999

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

配置:(httpd.conf)

<Directory "/var/www/html">

#
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important.  Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
    Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
    AllowOverride All

#
# Controls who can get stuff from this server.
#
    Order allow,deny
    Allow from all

</Directory>

备注:

  • 该网站基于dubdomain
  • 网站的根目录是 / var / www / html
  • 是否应启用.htaccess文件&#39;在网页代码本身?因为它目前不是。

如果还有其他配置文字需要,请说明。我真的想解决这个问题。

谢谢!

0 个答案:

没有答案