WordPress permalinks should be slashed

Monday, 25 April 2005

In WordPress 1.5, permalinks must end in a slash, otherwise the nextpage tag will not work.

In the Options/Permalinks screen of WordPress’s admin interface, I had my permalink format set to

/%year%%monthnum%%day%/%postname%

But then if I used a nextpage tag in a post, the next page links didn’t work. the links for subsequent pages were showing up as post-title2/, but clicking the links yielded a “page not found”.

It turns out that the link should have been post-title/2/. However, the code that generates the link seems to just add the page number after the parmalink, without checking whether it should also add a slash. To fix it simply, I just added a slash after the permalink, like this.

/%year%%monthnum%%day%/%postname%/

Now multi-page posts work fine.

There are other reasons why permalinks should end in a slash too. Maybe I will write about this sometime.

Tags:

One comment

You can leave a comment, or trackback from your own site.

  1. Nowadays I tend to think that WordPress permalinks should not end with a slash, simply because that makes them look like directories when they are not. But obviously I am not yet committed to this view — have a look at your address bar. 😉

Leave a comment