[wp-trac] [WordPress Trac] #34800: Canonical 301 redirects go to request origin instead of site_url
WordPress Trac
noreply at wordpress.org
Sun Nov 29 03:27:59 UTC 2015
#34800: Canonical 301 redirects go to request origin instead of site_url
-------------------------------+------------------------------
Reporter: sevcsik | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Canonical | Version: 4.3.1
Severity: normal | Resolution:
Keywords: reporter-feedback | Focuses:
-------------------------------+------------------------------
Comment (by sevcsik):
@johnbillion, thanks for the response.
According to CloudFront docs [1], the requests to the origin server are
sent with a host "set the value to the domain name of the origin that is
associated with the requested object." Which is in line of my general
(albeit maybe shallow) understanding of how CDNs work.
Regardless of my setup, I think using `site_url()` would be more
consistent with the way WordPress handles absolute URLs in general.
Template functions, such as `get_stylesheet_directory_uri`, or the login
redirection in `wp-admin` works the same way. I couldn't come up any other
examples when host is used for assembling absolute URLs rather than
`site_url()`.
I attached a diff which solves the issue, although I don't know if it
would break something else.
Cheers
[1]:
http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/RequestAndResponseBehaviorCustomOrigin.html
#request-custom-headers-behavior
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34800#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list