首先需要你的网站空间服务商支持自定义错误页,然后创建一个utu-8格式的404.php文件,代码如下:
[cc lang="php"] [/cc]
创建好之后上传至网站根目录下,然后自定义错误页为404.php页。这样就可以去后台-设置-固定链接设置而实现静态化了。但是这个方法会导致中文标签和一些相关地方的tags无法找到,解决办法是超找wp-include/classes.php中如下代码: [cc lang="php"] if ( isset(_SERVER['PATH_INFO']; else pathinfo = ''; pathinfo_array = explode('?', pathinfo); pathinfo = str_replace("%", "%", req_uri = _SERVER['REQUEST_URI']; [/cc]
修改为:
[cc lang="php"] if ( isset(_SERVER['PATH_INFO'], 'utf-8', 'GBK'); else pathinfo = ”; pathinfo_array = explode('?', pathinfo); pathinfo = str_replace("%", "%", req_uri = mb_convert_encoding(_SERVER['REQUEST_URI'], 'utf-8', 'GBK'); [/cc]