Opened 2 years ago
Last modified 22 months ago
#17183 new defect (bug)
previous_comments_link and next_comments_link return wrong url with PATHINFO permalinks
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Permalinks | Version: | 3.1.1 |
| Severity: | normal | Keywords: | needs-patch |
| Cc: |
Description
When using PATHINFO permalinks, previous_comments_link() and next_comments_link() return a wrong link, which renders paged comments useless.
Steps to reproduce:
Set permalinks to: /index.php/%post_id%/%postname%/
The functions return URLs similar to: /comments-page-1/#comments
This URL results in a file not found (if no rewrite rules are available, which should not be necessary if the PATHINFO permalink structure is used).
Expected URL: /index.php/comments-page-1/#comments
Manual opening the URL results in the expected/correct paged comments page.
Change History (7)
comment:1
Viper007Bond — 2 years ago
comment:2
solarissmoke — 2 years ago
- Keywords reporter-feedback added
If I set permalinks to
/index.php/%post_id%/%postname%/
And I go to a post with comments, the previous comment link points to:
http://localhost/wp/index.php/26/hello-world/comment-page-1/#comments
Which works fine. Can you clarify what your actual and expected links are?
comment:3
FireMotion — 2 years ago
My apologies, I now realize some information is missing:
I'm using a static page as my front page (and am not using any posts).
This is why, in my initial post, wrote: /index.php/comments-page-1/#comments, which indeed should be the expected URL (which is confirmed working, when manually entering the URL in a browser).
I'm guessing this is the cause of the problems (and it's confirmed working on other pages that are not the front page).
comment:4
FireMotion — 2 years ago
- Keywords reporter-feedback removed
comment:5
Viper007Bond — 2 years ago
Ah, so index.php is missing from the comment page links on the static page homepage. Got it.
comment:6
FireMotion — 2 years ago
Viper007Bond: Your summary is correct.
"index.php" is missing from the comment page links, when using paged comments, a static page and PATHINFO permalinks.
comment:7
SergeyBiryukov — 22 months ago
- Keywords needs-patch added

Correct URL would be /index.php/123/post-name/comments-page-1/#comments, not the URL described.