﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
19463,Archive page should not return 404 when requested page is larger than max page,kayue,,"Right now Wordpress return 404 when requested page number is larger than max page, and this could be a problem when people changed posts_per_page on query_posts.

For example, assuming the default post per page is 10 (in Reading Settings), and there are 15 posts in archive page (total 2 pages).

In archive.php, if I change the post_per_page to 5, there will be totally 3 pages. With the current implementation, the third page will return 404 page not found, because with the default setting, this page shouldn't exist.   

I suggest Wordpress should still load archive.php even requested page is larger than max page, and use have_posts() to determine what to display (similar to loop-home.php)  

Related discussions in forum:

* http://wordpress.org/support/topic/error-404-on-pagination-when-changing-posts_per_page-on-query_posts
* http://wordpress.org/support/topic/pagination-with-custom-post-type-listing?replies=23",defect (bug),closed,normal,,Query,,major,wontfix,needs-patch close,
