解决WordPress不支持中文TAG标签链接问题

首先,产生中文tag链接无法打开或者找不到博客文章的原因在于WordPress不支持中文的编码。那我们就需要强制让WordPress能支持中文的编码形式,即UTF-8和GBK编码。

修改方法,首先修改WP-include中的classes.php文件(需要使用用专门的PHP编辑器工具,推荐EditPlus),将下面的代码进行修改。

1、将 $pathinfo = $_SERVER['PATH_INFO'];

修改成

$pathinfo = mb_convert_encoding($_SERVER['PATH_INFO'], "UTF-8","GBK");

2、将 $req_uri = $_SERVER['REQUEST_URI'];

修改成

$req_uri = mb_convert_encoding($_SERVER['REQUEST_URI'], "UTF-8","GBK");
原文地址:
http://www.cksky.cn/archives/908

This entry was posted in Technology and tagged , , . Bookmark the permalink. 4,633 views

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *