wordpress本地测试站开启伪静态

作者:admin发表时间:2012-3-31 评论:1 点击 2,591+

首先打开httpd.conf 文件,找到LoadModule rewrite_module modules/mod_rewrite.so,去掉前面的#号。

找到你网站设置目录把 AllowOverride设置为All,默认显示的是None。

<Directory “E:/lamp/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.

    #

    Order allow,deny

    Allow from all

</Directory>

再去后台设置静态规则,我设置为这样的/%postname%.html 。

接下来看看网站根目录会自动生成.htaccess文件里面会写入如下内容

# BEGIN WordPress

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /w/

RewriteRule ^index\.php$ – [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /w/index.php [L]

</IfModule>

# END WordPress

/w/是我安装wp的目录。

接下来重启Apache就可以了。

顶一下 0 踩一下 0

你可能对以下内容感兴趣!

  1. 谷歌打不开,wordpress后台反应慢
  2. wordpress免费的备份插件BackUpWor...
  3. 谈一谈让wordpress更安全
  4. wordpress添加自定义默认头像
  5. 修改wordpress官方twentyeleven...
  6. 给wordpress友情链接页面添加Favicon...
  7. JQuery和CSS 版wordpress 弹性伸...
  8. wordpress 自定义评论表情

一个评论“wordpress本地测试站开启伪静态

发表评论

*

w_0002.gif w_0009.gif w_0007.gif w_0011.gif w_0005.gif w_0008.gif w_0010.gif w_0003.gif w_0012.gif w_0001.gif w_0006.gif