天方随笔
WordPress Permalinks
Blog » » »

我的wordpress的permalinks一直有问题。

我的wordpress也无法使用”pretty permalinks

/%year%/%monthnum%/%category%/%postname%/

而是必须加上index.php,变成”Almost Pretty

/index.php/%year%/%monthnum%/%category%/%postname%/

才可以正常访问

由于对中文支持的问题一直没有解决,所以在permalinks

/index.php/%year%/%monthnum%/%category%/%postname%/的structure

中如果%category%%postname%是中文,就会老是出现404页面无法找到的错误。

不过有方法替代:

  1. category slug.比如我的一个category是“天方”,定义其slug为”ken”,%category%就会显示为ken
  2. post slug.比如我的一篇post的post title是”α脑波音乐”,定义post slug为”α brain wave music”,那么%postname%也会如是显示

这样,我的permalinks的问题就告一段落啦。

不过还有一个残留的瑕疵,就是wb editor中不支持传递post slug的参数,所以不能完全离开wordpress的管理后台来写文章。看来除非自己写插件,提取文章中的[slug]xx[/slug]并且添加到post name字段中去才行。

07。14。

发现一个解决wb Editor和post slug的方法。

post经过wb editor通过xmlrpc方式投递的时候,wordpress会自动选取post title作为post name字段,而且只有一次。也就是说下次更新的时候post slug(post name)还是第一次的post title.

这样,我只要在第一次的时候,取一个英文名字,post.然后,再把post的title换成中文,再update 一下,就可以了。这样就不用自己写插件了。:)

———————————-

刚才花了我老长时间,终于把200篇blog的post slug都改成了英文的,赞

为这篇日志打一下分吧: 1 Stars2 Stars3 Stars4 Stars5 Stars

1 Votes | Average: 4 out of 51 Votes | Average: 4 out of 51 Votes | Average: 4 out of 51 Votes | Average: 4 out of 51 Votes | Average: 4 out of 5 (1 votes, average: 4 out of 5)



7 Responses to “WordPress Permalinks”

  1. Zhang-Zi Says:

    200篇,一篇一篇改?太佩服你了…

    对了,你下面的notify me of followup comments via e-mail是什么实现的?

  2. 天方 Says:

    哈哈,就当时一个练习英文的机会,做一下翻译,:)

  3. Sparanoid Says:

    Permalinks 不能完美支持是因为你的空间没开启 mod_rewrite 模块

  4. Sparanoid Says:

    permalinks 对中文的支持也不是乱码,是 bigendunicode,是浏览器的不支持,你可以试试 opera

  5. 天方 Says:

    谢谢Sparanoid指点迷津
    我用phpinfo()看了一下,发现真的没有启用mod_rewrite
    已经发邮件给空间商了,不知道能不能加上这个模块

  6. Sparanoid Says:

    这个模块比较费资源,估计不是特殊的空间他们不会开的

  7. 天方 Says:

    这个样子的啊,那就算了
    反正这样也可以了,比以前默认的链接地址好多了。
    发现用了permalink之后,对adsense其很大的作用,相应的adsense的内容准确多了

回复




  • Google
     
    Web blog.kenbeyond.com