[wp-trac] [WordPress Trac] #50976: WordPress stripping out "page" query parameter with 301 redirect

WordPress Trac noreply at wordpress.org
Fri Aug 28 20:50:50 UTC 2020


#50976: WordPress stripping out "page" query parameter with 301 redirect
-----------------------------+----------------------
 Reporter:  aleksihulkkonen  |       Owner:  (none)
     Type:  defect (bug)     |      Status:  closed
 Priority:  normal           |   Milestone:
Component:  Rewrite Rules    |     Version:
 Severity:  normal           |  Resolution:  wontfix
 Keywords:                   |     Focuses:
-----------------------------+----------------------
Changes (by Otto42):

 * status:  reopened => closed
 * resolution:   => wontfix
 * severity:  major => normal


Comment:

 @leec87 The redirection is not going to be reverted as it is for valid and
 important reasons. Please stop reopening the ticket.

 Also, to be clear, your problem is different than the issue in this
 ticket.

 For the case of a multi-page post, where the nextpage tag is used to split
 the page into multiple pages, then WordPress has always used page numbers
 in the URL, such as /slug/1/, /slug/2/ and so on.

 WordPress recognizes that /slug/number combination in its rewrite rules by
 default, and assigns pagename=slug and page=number in the internal query.

 The change to where /slug/1234/ gets redirected to /slug/ only happens
 where there is no page number of 1234. Previous versions would just show
 the first page on the wrong URL, which was undesirable behavior for SEO
 purposes.

 Now, if you happened to use that undocumented behavior to get that number
 from the URL and do something else with it, then you were relying on a
 side-effect of how WordPress worked. It was not intended to work that way,
 and it should not be used that way. If you want to use it in that fashion,
 then you should change your code to either remove the existing rewrite
 rule, or to add your own rewrite rule for your page, in order to
 specifically handle that type of behavior.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50976#comment:23>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list