[wp-trac] [WordPress Trac] #43539: Custom feed types breaks redirect_canonical behavior

WordPress Trac noreply at wordpress.org
Sat Mar 17 19:57:05 UTC 2018


#43539: Custom feed types breaks redirect_canonical behavior
------------------------------------------+------------------------------
 Reporter:  satantime                     |       Owner:
     Type:  defect (bug)                  |      Status:  new
 Priority:  normal                        |   Milestone:  Awaiting Review
Component:  Canonical                     |     Version:  4.9.4
 Severity:  normal                        |  Resolution:
 Keywords:  needs-unit-tests needs-patch  |     Focuses:
------------------------------------------+------------------------------

Comment (by satantime):

 Sure, while we're going to fix this issue - I'm fine.

 Let's change the issue of this ticket to

 custom feed types don't follow canonical redirect standard.
 when `http://localhost/feed` redirects to `http://localhost/feed/`,
 when `http://localhost/feed/atom` redirects to
 `http://localhost/feed/atom/`,
 but `http://localhost/feed/test` doesn't redirect to
 `http://localhost/feed/test/`

 should I just update title and description of this ticket?

 About your questions:

  `redirect_canonical()` should issue redirect in case when current url
 isn't canonical url.
 So for `http://localhost/feed/test` canonical url is
 `http://localhost/feed/test/` and when we access
 `http://localhost/feed/test` we should get redirected to
 `http://localhost/feed/test/` as we have with default feed types like
 atom, rss etc.

 `Moreover shouldn't the canonical URL be set to feed/test/ with a trailing
 slash. Might be what it's trying to do, but with some luck it seems that
 it prevents a redirect loop.`
 right - it should redirect to `feed/test/` but because every call just
 adds one more `feed/test/` and by the end `// protect against chained
 redirects` doesn't allow to trigger redirect.

 About how I found this - I'll tell you story after released fix :)

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


More information about the wp-trac mailing list