windows环境下WordPress的伪静态是通过httpd.ini来实现的,用txt建立一个httpd.ini文件,内容如下:
[ISAPI_Rewrite]
# Defend your computer from some worm attacks
#RewriteRule .*(?:global.asa|default\.ida|root\.exe|\.\.).* . [F,I,O]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
# Rules to ensure that normal content gets through
RewriteRule /tag/(.*) /index\.php\?tag=$1
RewriteRule /software-files/(.*) /software-files/$1 [L]
RewriteRule /images/(.*) /images/$1 [L]
RewriteRule /sitemap.xml /sitemap.xml [L]
RewriteRule /favicon.ico /favicon.ico [L]
# For file-based wordpress content (i.e. theme), admin, etc.
RewriteRule /wp-(.*) /wp-$1 [L]
# For normal wordpress content, via index.php
RewriteRule ^/$ /index.php [L]
RewriteRule /(.*) /index.php/$1 [L]
第二个问题,伪静态后,中文标签分类出现404错误,因为Win主机下wordpress不支持中文tag标签.
今天搞老费的我要网赚的总结经验,由于是换了系统,现在是iis,iis要做以下更改。
解决方法如下:
1.打开wp-include文件夹,找到并打开编辑class-wp.php文件.
2.查找代码:
$pathinfo = isset( $_SERVER['PATH_INFO'] ) ? $_SERVER['PATH_INFO'] : '';
把这句代码替换成:
$pathinfo = mb_convert_encoding($_SERVER['PATH_INFO'], "UTF-8", "GBK");
3.查找代码:
list( $req_uri ) = explode( '?', $_SERVER['REQUEST_URI'] );
把这句代码替换成:
$req_uri = mb_convert_encoding($_SERVER['REQUEST_URI'], "UTF-8", "GBK");
还没有评论,来说两句吧...