[wp-trac] [WordPress Trac] #28156: In date-containing permalink structures, /dddd/dd/comment-page-d/ urls don't work

WordPress Trac noreply at wordpress.org
Tue May 6 22:42:18 UTC 2014


#28156: In date-containing permalink structures, /dddd/dd/comment-page-d/ urls
don't work
--------------------------+-----------------------------
 Reporter:  mboynes       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Permalinks    |    Version:  3.9
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 I was in the process of writing a plugin to allow people to test their
 rewrite rules as they develop a site, and when I setup examples of core
 rewrite rules, one of them was failing.

 If you set your permalink structure to one containing dates, e.g. "Day and
 Name", one of the generated rewrite rules for posts is:

 {{{
 '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)(/[0-9]+)?/?$' =>
 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&name=$matches[4]&page=$matches[5]'
 }}}

 And later on, another rule is:

 {{{
 '([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/comment-page-([0-9]{1,})/?$' =>
 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&cpage=$matches[4]'
 }}}

 The URI /2014/5/6/comment-page-2/ would end up matching the earlier rule,
 looking for a post named "comment-page-2" published on 2014-05-06, instead
 of looking for comment page 2 in the... I actually don't even know what
 the comment-page URLs do. For me, the ones that work just redirect to the
 date archive.

 I'm happy to patch this, but would like to hear from someone else on what
 exactly should be done done. Do the comment-page-n rules do anything? Can
 they just be removed?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28156>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list