首页 > CMS建站 > Wordpress > 正文

修改固定链接后不能访问文章问题_访问时提示404错误

2020-06-10 13:08:20
字体:
来源:转载
供稿:网友

修改固定链接后不能访问文章问题,或者访问时提示404错误,如果你的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将被忽略,正确的设置如下:

  1. Directory / 
  2.     Options FollowSymLinks 
  3.     AllowOverride All 
  4. #    Order deny,allow 
  5. #    Deny from all 
  6. /Directory 

也需要在DocumentRoot打开AllowOverride:

  1.  Directory "D:/wamp/www/" 
  2.     # Possible values for the Options directive are "None", "All", 
  3.     # or any combination of: 
  4.     #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews 
  5.     # Note that "MultiViews" must be named *explicitly* --- "Options All" 
  6.     # doesn't give it to you. 
  7.     # The Options directive is both complicated and important.  Please see 
  8.     # http://httpd.apache.org/docs/2.2/mod/core.html#options 
  9.     # for more information. 
  10.     Options Indexes FollowSymLinks 
  11.     # AllowOverride controls what directives may be placed in .htaccess files. 
  12.     # It can be "All", "None", or any combination of the keywords: 
  13.     #   Options FileInfo AuthConfig Limit 
  14.     AllowOverride all 
  15.     # Controls who can get stuff from this server. 
  16. #   onlineoffline tag - don't remove 
  17. #    Order Allow,Deny 
  18. #    Allow from all 
  19.  /Directory 
注意,以上修改完成后,要重启Apache才能生效。

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选