WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 11 months ago

#40773 closed defect (bug) (duplicate)

Hello, I found the problem with permalink on the site in the latest version of WordPress.

Reported by: prografika Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.9
Component: Permalinks Keywords:
Focuses: Cc:
PR Number:

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 (3)

#1 @subrataemfluence
3 years ago

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?

#2 @dd32
2 years ago

  • Version changed from 4.7.4 to 2.9

The original description sounded like a duplicate of #11694 which was fixed in 4.4.

It appears that the fix in #11694 / [34492] only applied to posts which have pages, when pagination doesn't exist, the redirects added there ignored.

#3 @SergeyBiryukov
11 months 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.

Note: See TracTickets for help on using tickets.