以下就是怎么实现的:
只要主机支持自定义404页面,无需安装插件,就能让Win主机像Linux 那样,方便使用WordPress的固定链接为静态化地址格式。
<?php
header("HTTP/1.1 200 OK");
$ori_qs = $_SERVER['QUERY_STRING'];
$pattern = '/[^;]+;[^:]+://[^/]+(/[^?]*)(?:?(.*))?/i';
preg_match($pattern, $ori_qs, $matches);
$_SERVER['PATH_INFO'] = $matches[1] . '?' . $matches[2];
$_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO'];
$query_args = explode('&', $matches[2]);
unset($_GET);
foreach ($query_args as $arg)
{
$the_arg = explode('=', $arg);
$_GET[$the_arg[0]] = $the_arg[1];
}
include('index.php');
?>
设置固定链接(Permalink)伪静态步骤:
1. 将以上代码保存为 404.php,并上传至主机根目录。
2. 设置 404 自定义错误页为 404.php。
3. 进入 WordPress 控制面板,设置(Options)- 固定链接(Permalinks),选择固定链接格式。
运行效果

我是在windowsXP下安装的apache2.2.4 和php5.2,在apache下不用安装ReWrite ISAPI包,只有在IIS下才用。
方法如下:
编辑apache的配置文件httpd.conf
第一步:找到
<Directory “F:\webhosts”> 其中”F:\webhosts”是你自己设置的虚拟目录,根据你自己的设置会有不同
#
# 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 None ***就把这个改成AllowOverride All***
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
把其中的AllowOverride None 改成AllowOverride All
第二步:
搜索 LoadModule rewrite_module modules/mod_rewrite.so (Apache2是这个)
去掉前面的#
第三步:
重启 apache
第四步:
直接去后台 营销推广–>SEO设置–>商店页面启用伪静态URL 打上勾 保存。OK。