1 、写httpd.ini(写好后放在网站根目录下)
[ISAPI_Rewrite]
# 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 throughRewriteRule /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]
2 、如果博客地址含有中文,或标签是中文的,就会转到 404 页面,是通过 httpd.ini 解决不了的,必须来修改源代码。
修改网站目录下wp-includes/class-wp.php文件 (请先行备份):
第一步:找到
$pathinfo = $_SERVER['PATH_INFO'];
修改为
$pathinfo = mb_convert_encoding($_SERVER['PATH_INFO'], 『UTF-8′, 『GBK』);
第二步:找到
$req_uri = $_SERVER['REQUEST_URI'];
修改为
$req_uri = mb_convert_encoding($_SERVER['REQUEST_URI'], 『UTF-8′, 『GBK』);
就这样,中文的 TAG 标签页等都可以打开了的。