wordpress 3.8如何解决中文标签404

手册/FAQ (763) 2015-10-13 13:40:31

      但是随着wordpress3.8的推出,之前的修改方法已经不行了,加上之前的方法网上本来就很多是错误的,导致3.8的修改方法几乎百度不知道,顶多只有一个百度经验,却是通过安装插件的间接方法。

今天给大家分享:

wordpress3.8中文标签或者路径的根本解决方法

首先打开wordpress站点根目录中wp-includes目录下文件:“class-wp.php“

找到代码:

 

$pathinfo = isset( $_SERVER['PATH_INFO'] ) ? $_SERVER['PATH_INFO'] : '';

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

                         $pathinfo = str_replace( "%", "%25", $pathinfo );

                          list( $req_uri ) = explode( '?', $_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("%", "%", $pathinfo_array[0]); $req_uri = mb_convert_encoding($_SERVER['REQUEST_URI'], "UTF-8", "GBK");

上传替换即可!

 

THE END