Make WordPress Core

Opened 8 years ago

Last modified 6 weeks ago

#43544 new defect (bug)

Pages over 999 in archive return 404

Reported by: catalinnita's profile catalinnita Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.9.4
Component: Rewrite Rules Keywords: reporter-feedback
Focuses: Cc:

Description

Whenever you have more than 3 digits page numbers WordPress returns a 404.

Change History (6)

#1 follow-up: @soulseekah
8 years ago

Possibly related #7467 and #5305

What is your permalink structure? What URL are you trying to access?

#2 @soulseekah
8 years ago

  • Keywords reporter-feedback added

#3 in reply to: ↑ 1 @catalinnita
8 years ago

there is a conflict between 4 digits page numbers and year in permalinks.
for example if you go here http://www.radiotimes.com/news/page/3832/ it goes to 404 because it considers 3832 to be an year and is no archive page for that year of course.

could be this rule

[([0-9]{4})/?$] => index.php?year=$matches[1]

or a different one, I'm in the process of isolating it. I'll update the ticket when I'll find out.

Thank you!

Replying to soulseekah:

Possibly related #7467 and #5305

What is your permalink structure? What URL are you trying to access?

#4 @catalinnita
8 years ago

the problematic rule is

[(.+?)/([0-9]{4})/?$] => index.php?category_name=$matches[1]&year=$matches[2]

in my rules list it's before ( uncategorized is the category I am testing with )

[(uncategorized)/page/?([0-9]{1,})/?$] => index.php?category_name=$matches[1]&paged=$matches[2]

setting the first rule at the end of the rules array it solves the issue.

#5 @boonebgorges
7 years ago

  • Component changed from Taxonomy to Rewrite Rules

#6 @callumbw95
6 weeks ago

Hi @catalinnita,

I've just reviewed this ticket and attempted to recreate the issue in a clean installation of the latest release (6.8.3). Unfortunately, I haven't been able to reproduce it. Are you still encountering this problem? Could you please provide additional details that might help us pinpoint the cause?

For reference, I've included a testing report below outlining the steps I've taken:

Testing Report

Environment

  • WordPress: 6.8.3
  • PHP: 8.4.7
  • Server: nginx/1.27.5
  • Database: mysqli (Server: 8.0.40 / Client: mysqlnd 8.4.7)
  • Browser: Chrome 141.0.0.0
  • OS: macOS
  • Theme: Twenty-Five 1.3
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Steps taken

  1. Installed WordPress 6.8.3 on a fresh environment.
  2. Created a "Posts" page and designated it as the front-end for the posts archive.
  3. Generated over 10,000 posts using WP-CLI, as the default is 10 posts per page.
  4. Tested these URLs:
    • ✅ - /posts
    • ✅ - /posts/page/10/
    • ✅ - /posts/page/100/
    • ✅ - /posts/page/999/
    • ✅ - /posts/page/1000/
Note: See TracTickets for help on using tickets.