WordPress permalinks should be slashed

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.

Share This | Comments | Permalink | Trackback | Comments feed

One response

  • 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. ;)

    Bennett | 12 July 2008

Post a comment

(required)
(required)
(some HTML allowed; for literal < and &, use &lt; and &amp;)
Close
E-mail It