wordpress本地测试站开启伪静态
发表时间:2012-3-31 评论:1 点击 3,791+
首先打开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就可以了。
网站确实不错,支持一下。