WordPress permalink nextpage doesn’t work

I’ve been struggling with an aspect of WordPress that should ‘just work’ but didn’t. That is, if you have decided to restrict the number of pages/posts shown on a page, WordPress automatically generates a ‘next page’ and ‘previous page’ button.

This works fine if you have the standard ‘ugly permalinks’ set up, but if you use custom permalinks it breaks.

The problem is with the .htaccess code that WordPress generates – at least if you’re using it on a server that runs PHP as a CGI. To fix it, I simply edited the .htaccess and instead of the RewriteRule looking thus;

RewriteRule . /index.php [L]

Make it

RewriteRule (.*) /index.php/$1 [L]

This has the effect of passing the PATH_INFO data through to index.php which was stripped by the previous rule. Now WordPress will find your pages properly again and all will work 🙂

This fixes the problem of permalink nextpage giving a 404 error page. The existing WordPress articles probably will work for you if you’re just seeing the ‘no posts’ error.

Author: Steve Brown

Steve is a paramedic in Victoria, Australia who is also an ex-IT Consultant and currently uses all manner of MacOS software in his everyday life. So he usually tends to write about his experiences with that. But sometimes he'll write about medical, political or other stuff that might (or might not!) be of interest

One thought on “WordPress permalink nextpage doesn’t work”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.