更新于 10 11 月, 2021
wordpress中文路径出现404错误的解决办法
修改GBK字符编码为utf-8。
wp-includes/class-wp.php文件
165行:
$pathinfo = isset( $_SERVER['PATH_INFO'] ) ? $_SERVER['PATH_INFO'] : '';
改为:
$pathinfo = isset( $_SERVER['PATH_INFO'] ) ? mb_convert_encoding($_SERVER['PATH_INFO'],'utf-8', 'GBK') : '';
169行:
list( $req_uri ) = explode( '?', $_SERVER['REQUEST_URI'] );
改为:
list( $req_uri ) = explode( '?', mb_convert_encoding($_SERVER['REQUEST_URI'], 'utf-8','GBK') );
转自CSDN,本文有稍作修改。
我来啦 哈哈哈