您的位置:首页 > 运维架构 > 网站架构

wordpress设置固定连接后,打不开网站

2015-08-28 11:08 309 查看
作者:www.gudianxiaoshuo.com



rewrite是apache环境的一个伪静态功能了,如果我们没有没让Apache开启rewrite功能,网站上所有的rewrite规则都不可使用



开启过程如下:
  centos的配置文件放在: /etc/httpd/conf/httpd.conf

  打开文件找到:
  LoadModule rewrite_module modules/mod_rewrite.so
  将前面“#”去掉,如果不存在则添加上句。

  如果你的网站是根目录的话:找到
  
  Options FollowSymLinks
  AllowOverride None
  
  将上面的None改为All

  如果你的站点不在根目录,设置如下:
  
  Order allow,deny
  Allow from all
  AllowOverride All
  

  OK,然后重启服务器,service httpd restart ,这样。htaccess就可以使用了。



遇到的问题:

一开始我就是按照网上的资料这么设置的,但是怎么也修改不了固定连接,一设置为固定连接,就打不开。

今天我又尝试设置了下

发现 AllowOverride None 不仅以处有,要修改两处 才管用

第一处

<Directory />

Options FollowSymLinks

AllowOverride All

</Directory>



第二处 紧跟着第一处

#

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

然后 :wq保存后

重启APPACH

service httpd restart

就可以了

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: