Opened 2 years ago
Last modified 2 years ago
#55993 new defect (bug)
Wrong canonical redirect for paged posts page
Reported by: | Chouby | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Canonical | Keywords: | needs-testing-info |
Focuses: | Cc: |
Description
- Setup a site with a static front page and a posts page (let's call it "Posts").
- Take note of the page_id of the posts page. 265 in my case.
- Make sure to use pretty permalinks.
- Create sufficient posts to be able to display the page 2 of the posts page.
- In the address bar, type
https://mysite.com/?page_id=265
(the posts page plain permalink) => The site is correctly redirected tohttps://mysite.com/posts/
- In the address bar, type
https://mysite.com/?paged=2&page_id=265
(the paged posts page plain permalink) => The site is wrongly redirected tohttps://mysite.com/page/2/
and displays an empty content. I would expect the url to be redirected tohttps://mysite.com/posts/page/2/
Change History (4)
#2
@
2 years ago
- Keywords reporter-feedback added; needs-patch needs-unit-tests removed
Testing on latest trunk, I can't seem to be able to reproduce the issue.
- Set the posts page to a page with id=146
- Tried with all the permalink settings other than 'plain'
- The paged 'plain' link still works as expected for me, with both these 2 formats:
@Chouby can you still reproduce the issue on latest trunk, with all plugins deactivated an one of the bundled themes active?
#3
@
2 years ago
@afercia Yes I confirm that the bug still exists. I just re-tested with the development version (6.2-alpha-54748) and Twenty Twenty One.
I took the opportunity to debug a bit.
At this line, $addl_path
is filled with the pagination base and number. Previously, it's an empty string. Then the redirect path is filled here.
#4
@
2 years ago
- Keywords needs-testing-info added; reporter-feedback removed
Thanks @Chouby. I'm afraid I still can't reproduce. Something like ?paged=2&page_id=265
correctly brings me to the second page of the Posts page. Wondering if there's a missing step in the tests instructions or maybe some setting in your environment that is triggering the wrong behavior.
Hi there, thanks for the ticket!
This appears to be related to #28081 and #50163, but also seems like a distinct issue, as the page does actually exist.