Posts Tagged '固定链接'

wordpress主页乱码和错误问题

Posted by Danfi on 2010-03-25 1条评论

昨天搞了一天也没解决的问题:原本固定链接使用的是/index.php/%postname%.html形式的,我想改成/%postname%.html或者/%post_id%比较简单的类型,但是一旦改成简单的,头部就会出现类似

  1. Warning: preg_match() [function.preg-match]: Compilation failed: nothing to repeat at offset 1 in /wp-includes/classes.php on line 210
  2. Warning: preg_match() [function.preg-match]: Compilation failed: nothing to repeat at offset 1 in /wp-includes/classes.php on line 211

这样的代码,害我网上百度,谷歌搜了一整天,找到的方法都没治标,有的能解决乱码问题,但是又会出现404问题。
今天我一狠心,备份好所有文件后,清空数据库和空间,然后重新上传wordpress,安装后还算正常,进入后台连忙改掉固定链接和标签前缀,结果问题又出来了,仔细想想标签前缀这东西相当可疑呐,去掉后一切恢复正常了,原本因为用了?tag=这个标签前缀的话可以支持中文别名,添加起来比较方便,现在不得不放弃了

wordpress修改固定链接后出现乱码问题

Posted by Danfi on 2010-03-24 添加评论

今天修改了wordpress的固定链接,可是首页的中文出现乱码,而且头部也出现类似

  1. Warning: preg_match() [function.preg-match]: Compilation failed: nothing to repeat at offset 1 in */wp-includes/classes.php on line 210
  2. Warning: preg_match() [function.preg-match]: Compilation failed: nothing to repeat at offset 1 in */wp-includes/classes.php on line 211

的问题,于是网上搜索,在 Error After Setting Permalinks这个页面下得到了答案,只要在210行上面加一句

  1. $match = str_replace('?', '\?', $match);

问题就解决了