yo2速度实在太慢,索性搬家。新空间是windows+iis,wordpress的permentlink比较难弄,最后找了个办法,链接也丢了。方法是设置一个404转向,在你的空间里面新建一个比如wp404.php文件,内容如下:

<?php
$qs = $_SERVER['QUERY_STRING'];
$_SERVER['REQUEST_URI'] = substr($qs, strpos($qs, ‘:80′)+3);
$_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'];
include(‘index.php’);
?>


然后在主机管理里面将404跳转指向这个wp404.php文件,然后后台就可以设置你的permentlink了。但是url只能是英文字母或者数字,字符。

Update: 找到了url为其它字符的解决方法,打开wp-includes/classes.php,然后做如下修改:

wp-include/classes.php中(44-50行)
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'];

替换为下(转换$_SERVER['PATH_INFO']和$_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”);

注意上面的双引号,写博客的时候都是英文半角的双引号,但是发到博客里面就变了,应该是wordpress的一个小bug

Home

No Comments Now!

Be the first to comment on this entry.

Leave a comment

Name(required)
Mail (required),(will not be published)
Website(recommended)

Fields in bold are required. Email addresses are never published or distributed.

Some HTML code is allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
URLs must be fully qualified (eg: http://lijie.org),and all tags must be properly closed.

Line breaks and paragraphs are automatically converted.

Please keep comments relevant. Off-topic, offensive or inappropriate comments may be edited or removed.

Get Adobe Flash playerPlugin by wpburn.com wordpress themes