WordPress插件:Nice Trailingslashit

更新时间: 2008年5月5日

一、WordPress自定义永久链接结构的细微区别

  WordPress后台设置的自定义永久链接结构默认提供五种方式,分别是:

1、/?p=123
2、/2008/05/04/sample-post/
3、/2008/05/sample-post/
4、/archives/123
5、/blog/archives/%post_id%.html

  对于2、3这两种永久链接结构来说,是带“/”的,而4、5这两种永久链接结构来说,是不带“/”的。他们之间有什么区别呢?

  默认带“/”的永久链接结构,对于feed页,分类页,页面页,存档页末尾都是带“/”的,例如:

/feed/
/categories/wordpress/
/download/
/archives/date/2008/03/

  而默认不带“/”的永久链接结构,对于feed页,分类页,页面页,存档页末尾都是不带“/”的,例如:

/feed
/categories/wordpress
/download
/archives/date/2008/03

二、优化你的WordPress自定义永久链接结构

  很多朋友使用的永久链接结构是:“/blog/archives/%post_id%”,或者“/blog/archives/%post_id%.html”等末尾不带“/”的自定义永久链接结构。

  这种永久链接结构的副作用就是上面所说的,默认不带“/”的永久链接结构,对于feed页,分类页,页面页,存档页末尾都是不带“/”的,这点对于日期存档页来说是非常恐怖的,因为他生成的地址会变成:“/archives/date/2008/03”,末尾没有“/”。

  而我们可能希望在使用这种末尾不带“/”的永久链接结构的同时,让feed页,分类页,页面页,存档页末尾都带“/”,这该怎么办呢?

三、Nice Trailingslashit插件介绍

  Nice Trailingslashit插件就是基于以上想法编写出来的一个优化你的WordPress的永久地址的插件。

  当你使用形如:“/archives/123”、“/blog/archives/%post_id%.html”这样的永久链接结构的时候,你的feed页,分类页,页面页,存档页末尾依旧会带上“/”。

四、Nice Trailingslashit插件下载

  Nice Trailingslashit插件在WordPress官方插件页下载地址

http://downloads.wordpress.org/plugin/nice-trailingslashit.zip

  或者通过本插件的svn库来获得最新的版本:

http://svn.wp-plugins.org/nice-trailingslashit/

五、Nice Trailingslashit插件安装

  这个插件安装非常简单,将其解压缩后,连同nice-trailingslashit目录上传到你的WordPress的wp-content/plugins目录,然后在后台将其启用就可以使用了,无需任何配置。

  本插件支持WordPress 2.2+所有版本,欢迎大家使用。在使用过程中如有疑问,欢迎邮件与我联系:wuweixin#gmail.com

  1. 2008年7月29日11:34

    在沒用這個插件前 /feed 是 這個
    其他分類存檔卻正確,但是用了插件以后 /feed/ 也是 ,分類存檔頁也正確 ,也就是說,不管用不用插件,從首頁進feed 總是 ,如何解決?

  2. 2008年7月29日15:23

    你现在的站的 feed 状态不是正常的么?

  3. 2008年7月29日15:36

    请问下http://my.ceomonkey.com/feed/和http://my.ceomonkey.com/feed/ 有什么區別?

  4. 2008年7月29日17:46

    这两个地址不是一模一样么?

  5. 2008年7月29日19:46

    感覺很奇怪,直接輸http://my.ceomonkey.com/feed/能看到feed頁,但從首頁進去卻是xml頁,不過很感謝~~~那些東西我自己去弄懂好了

  6. 2008年7月29日21:02

    feed页确实就是xml的 :)

  7. 2008年8月15日08:28

    OHhhh, the frustration of not being about to read Chinese! Anyways, my webhost installed this plugin for me to use for WordPress, however, without documentation (will have to check the WordPress site) at this time, it's not entirely user-friendly (out of the box anyways).

  8. 2008年9月10日01:27

    说得挺详细的

  9. 2009年3月30日00:32

    你好,你能不能到我博客上看看,我启用Advanced Permalink插件来同时使用/%year%/%monthnum%/%postname% 和/%postname%-%post_id%.html 两种地址格式,我怎样才能在前者加/,后者不加/呢,盼回复。

  10. 2009年3月30日00:35

    我说的是/%year%/%monthnum%/%postname%也加上/,即便我设置成/%year%/%monthnum%/%postname%/,但由于/%postname%-%post_id%.html 后面没有/,因此用你的插件/%year%/%monthnum%/%postname%也加不了/.....

  11. 2009年8月1日02:06

    This plug-in was very useful. Thank you.

  12. 2010年4月26日14:38

    看下我用的,为啥feed后面多了斜杠呢