首页 > 解决方案 > 启用 Mod Rewrite 并将 AllowOverride 设置为 All,但 .htaccess 仍然无法正常工作

问题描述

我在 Centos 7 上运行 Apache 2.4.6。正如标题所说,我已经验证了 mod rewrite 已启用,这就是我的 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.4/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.
#
Require all granted
</Directory>

但由于某种原因,我的 .htaccess 仍然无法正常工作。现在我只是把我的所有指令放在同一个目录元素中(我没有复制那部分,我知道这不是问题,因为我只是在无法获得 .htaccess 后才这样做的最后手段工作)。如果有人可以提供帮助,将不胜感激。

标签: apache.htaccessmod-rewritecentos7httpd.conf

解决方案


推荐阅读