no comments yet
21 Jun 2018

Apache开启.htaccess支持

编辑Apache安装目录下的/conf/httpd.conf:

第一步,打开rewrite模块

vi /etc/httpd/conf/httpd.conf

找到:#LoadModule rewrite_module modules/mod_rewrite.so,去掉前面的#号,改为:

LoadModule rewrite_module modules/mod_rewrite.so

第二步,打开文件允许重载

搜索 '.htaccess',找到如下注释对应的AllowOverride None:

#  
# 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 None  

将AllowOverride None改为:

AllowOverride All

最后重启Apache服务:

service httpd restart