IIS下配置WordPress固定链接支持中文URL版

打开wp-includes/classes.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 = iconv(‘GBK’, ‘UTF-8’, $_SERVER[‘PATH_INFO’]);
else
$pathinfo = ”;
$pathinfo_array = explode(‘?’, $pathinfo);
$pathinfo = str_replace(“%”, “%25”, $pathinfo_array[0]);
$req_uri = iconv(‘GBK’, ‘UTF-8’, $_SERVER[‘REQUEST_URI’]);这样通过伪静态软件就可以支持文章的URL链接为中文了。

Leave a Reply

Your email address will not be published.