首页 > php > windows下apache支持wordpress的url rewrite

windows下apache支持wordpress的url rewrite

参考文章:http://sexywp.com/how-to-config-mod-rewrite-in-win.htm

在本地调试wordpress时apache服务器可能不支持url rewrite,可以根据如下步骤修改配置:

1.打开apache的配置文件:httpd.conf 搜索:LoadModule rewrite_module modules/mod_rewrite.so
把前面的#去掉

如果执行完第一步,重启服务器后,还是不支持url rewrite,那么执行第二步

2.在 httpd.conf 中存在下面格式的文字

<Directory "D:/tools/Apache2.2/htdocs">
    #
    # 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>

AllowOverride None 改为 AllowOverride All 就可以了。
(注意:可能有多个Directory标签,找到你wordpress所在目录的那个修改)

3.重启apache,这样apache就支持url rewrite了

–EOF–

分类: php 标签: , ,
  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.