#40773 closed defect (bug) (fixed)
Redirect paged requests for non-paginated posts to avoid duplicate content
Reported by: | prografika | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.5 | Priority: | normal |
Severity: | normal | Version: | 2.9 |
Component: | Canonical | Keywords: | |
Focuses: | Cc: |
Description
Hello, I found the problem on the site in the latest version of WordPress. If we open a page or record on any site version 4.7.4 and add arbitrary numbers to the address, then instead of page 404 we will see a copy of the content.
For example:
Https://mybilet.info/moskva-gruziya-aviabilety/
And the same can be seen from the link
Https://mybilet.info/moskva-gruziya-aviabilety/6546/
Because of this, search engines define pages as non-canonical.
Change History (11)
#3
@
6 years ago
- Milestone Awaiting Review deleted
- Resolution set to duplicate
- Status changed from new to closed
Hi there, welcome to WordPress Trac!
Thanks for the report, we're already tracking this issue in #28081.
#4
@
5 years ago
- Component changed from Permalinks to Canonical
- Milestone set to 5.5
- Resolution duplicate deleted
- Status changed from closed to reopened
- Summary changed from Hello, I found the problem with permalink on the site in the latest version of WordPress. to Redirect paged requests for non-paginated posts to avoid duplicate content
Reopening, let's fix this as a standalone issue, as #28081 is slightly different.
Note: See
TracTickets for help on using
tickets.
I could reproduce the issue and tried to get some more information about it.
I have a page
site.com/trips/dharamsala-deemed-smart-city/
. If I add an arbitrary number to the end of it, the page still loads fine, e.g /trips/dharamsala-deemed-smart-city/9987, but if I add a non-numeric value in place of 9987, e.g. 98xx the page no longer comes up!The first thing we need to know how this additional parameter is being treated by WordPress and why only numeric values are being accepted.
For the same above URL, the plain mode comes up as
site.com/?trips=dharamsala-deemed-smart-city
. Now if I add an additional parameter e.g. x=9987, the page loads. Even x=9987x does not prevent the page from loading with content!If I haven't understood wrong, pretty permalinks actually encapsulate the real URL inside it by. I tried to get that actual underlying URL so that the query string parameters could be revealed but I couldn't. I was unable to find a function in core which outputs the above.
However, the first parameter in my URL is "trips" so if I add a number to end of this URL, WordPress still can match the first parameter value and finds the content.
But if above is true then why not with an alphanumeric value?
Also why both numeric and alphanumeric values are accepted when I use plan mode?