一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

解决wordpress修改固定链接页面出现404错误问题

时间:2022-06-25 19:01:38 编辑:袖梨 来源:一聚教程网

如果你的Apache、PHP、Mysql系统架构是自己配置的,或使用的某些安装包,可能会有这个问题,具体解决办法如下:

(1)Apache中的rewrite模块没有开启,在配置文件httpd.conf中去除这一行前面的#号就可以了

#LoadModule rewrite_module modules/mod_rewrite.so

变为:

LoadModule rewrite_module modules/mod_rewrite.so

(2)AllowOverride Not Enabled 

服务器可能没打开AllowOverride。

如果Apache中配置文件httpd.config的AllowOverride设置的是None,那.htaccess将被忽略。

正确的设置: 

 代码如下 复制代码

Directory /
Options FollowSymLinks
AllowOverride All
# Order deny,allow
# Deny from all
/Directory

也需要在DocumentRoot打开AllowOverride:

 代码如下 复制代码

Directory “D:/wamp/www/”
# 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.
# onlineoffline tag – don’t remove
# Order Allow,Deny
# Allow from all
/Directory

注意,以上修改完成后,要重启Apache才能生效。

热门栏目