7 Minute Miles

WordPress Pagination Issue

Posted Saturday, November 17th, 2012 01:26 am GMT -5 in Housekeeping, Longform, Technology

Not sure when it started happening, but if you scroll to the bottom of the 7minutemiles.com home page and hover over the “Older posts” link, the URL shows as 7minutemiles.com/page/2. My web server, though, is redirecting that back to 7minutemiles.com via an Apache 301 redirect. Not good.

The older posts can be viewed by using a different URL – 7minutemiles.com/?paged=2 for the second page of posts, 7minutemiles.com/?paged=3 for the third page, and so on. So at least I know they are still there.

This type of problem is usually related to the Permalinks section in WordPress Settings and the .htaccess file it manipulates. I checked out the current .htaccess file, recreated it, restored an old version from backup to compare and tried various structural settings within the admin section (default works, but I want my standard day and name URLs that match what Google has indexed).

What’s weird is that pagination within category pages works fine (i.e. – 7minutemiles.com/category/golf/page/2 for example). My web server log isn’t throwing any errors and seems to be configured the same as it ever was (no recent upgrades). I did have a few Jetpack plugin upgrades recently, but deactivating that made no difference. I’m also not using any add-in pagination plugins.

A WordPress support site had a few threads mentioning that the 3.4 upgrade changed some things with pagination, but I’m pretty sure it was working since I moved to the 3.4.x series (currently on 3.4.2). My issue is a little different than that post, plus you wouldn’t think you’d need a function.php fix for basic pagination on the home page. Here is my theme PHP code that generates the link:

next_posts_link('« Older posts')

That generates the right URL, so I’m confused as to whether this is a WordPress issue or an Apache issue. Guess I’ll look at it with fresh eyes tomorrow…

Originally published by DK on November 17, 2012 at 1:26 am

DK on Twitter Email DK 7 Minute Miles RSS Feed

Looking for something?