Pagination on single.php causing 301 redirect
-
Hi All,
Apologies if this has been asked before, but hours of googling have produced nothing.
I have a custom query with pagination on a single.php page. The exact same code is working in my category.php. The pagination is printing properly and the links printing correctly. My permalinks setting is /%category%/%postname%, so a default URL will look like mysite.com/news/news-article. The previous_posts_link() is printing out the proper URL as mysite.com/news/news-article/page/2. Once I hit that link, the Net tab in Firefox shows that the URL /news/news-article/page/2 has been 301 redirected to /news/news-article, so the pagination is never updated. The default posts per page is set to 1 and the posts_per_page in my query has been set to 5. My .htaccess is as follows, automatically set up by WordPress – I haven’t touched it.# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
Anybody seen anything like this before and have any idea how to fix it? I’d really hate to have to write my own paging functions when WP has such functionality built in, but I’m afraid I may have to.
Please help save what little hair I have left!
Thanks much,
Garrett
- The topic ‘Pagination on single.php causing 301 redirect’ is closed to new replies.