0

产生这个问题的主要原因是地址编码问题,及UTF-8和GBK之间转换的问题。IIS 对 URL 截取的时候取得的是 GBK 编码,但是 WordPress 中文都用的 UTF-8 编码,所以我们要对编码进行处理后再交给数据库进行查询。

转换编码解决 WordPress 中文 Tag 链接问题(推荐)

打开文件:wp-includes\classes.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”);保存,上传,问题解决。

Tags: , , , | 分类:电脑网络 | 来源:本站原创 | 引用(0)
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]