一聚教程网:一个值得你收藏的教程网站

热门教程

wordpress伪静态中文tag标签无法出错

时间:2022-06-25 16:36:21 编辑:袖梨 来源:一聚教程网

具体步骤如下:
修改网站 /wp-includes/class-wp.php中如下代码

 代码如下 复制代码

if ( isset($_SERVER['PATH_INFO']) )

$pathinfo = $_SERVER['PATH_INFO'];

else

$pathinfo = '';

$pathinfo_array = explode('?', $pathinfo);

$pathinfo = str_replace("%", "%25", $pathinfo_array[0]);

$req_uri = $_SERVER['REQUEST_URI'];

修改为

 代码如下 复制代码

if ( isset($_SERVER['PATH_INFO']) )

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

else

$pathinfo = ”;

$pathinfo_array = explode('?', $pathinfo);

$pathinfo = str_replace("%", "%25", $pathinfo_array[0]);

$req_uri = mb_convert_encoding($_SERVER['REQUEST_URI'], 'utf-8', 'GBK');

即可

其实我们总结一下就是

 代码如下 复制代码

查找:$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”);

即可了.

热门栏目