Opened 7 years ago
Last modified 7 years ago
#42512 new defect (bug)
Domain with special character redirect loop on homepage
Reported by: | stefan-niedermann | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 4.5 |
Component: | Canonical | Keywords: | needs-patch |
Focuses: | Cc: |
Description
Hi,
i am experiencing a problem with wordpress starting with 4.5 i think.
Since this commit [1] i always get redirect loops on the home page. this issue seemed to be fixed, and i can confirm this on various wordpress instances.
But one instance has a domain with a special character ("ö" - german Umlaut), and the problem persists there.
Also i am not the only user who can confirm this issue [2].
Currently i have to reset the line [3] to the old value after every update since it gets overwritten. This is not a solution, only a very bad workaround.
Of course i already have tried to disable all plugins, themes etc. which could cause the issue. I can say, that the problem is not caused by the hoster since i have many wordpress instances running on the same hoster and no other does have this problem (and no other have a special character in the domain)
Regards
[1] https://github.com/WordPress/WordPress/commit/84a3b4407f9e03311aa591004f3bec0639f3ba3f?diff=unified
[2] https://wordpress.org/support/topic/45-causes-infinite-redirect-on-static-front-page/page/2/#post-8156893
[3] https://github.com/WordPress/WordPress/commit/84a3b4407f9e03311aa591004f3bec0639f3ba3f?diff=unified#diff-dc3247fd3fa65f15e6fc5ce8c6fa2d42L175
Hey @stefan-niedermann Sorry for the length of time before this got a reply, as I said on Github, we've got more open tickets than volunteer time to manage them.
Just noting that this is indeed an issue when using UTF8 characters directly in the hostname. Using punycode encoded hostnames fixes this.
The issue is caused by a mis-match in how WordPress treats the hostname, for example, the hostname that the browser sends for
http://centös/
ishttp://xn--cents-mua/
, those two strings don't match so WordPress will redirect tohttp://cent%C3%B6s/
as part of the canonical code.This is triggered on the front-page when a static home-page is used, as we set
$redirect_url
tohome_url('/')
assuming that it'll match$requested_url
and abort, but that doesn't happen in this scenario.Short-term solution: Set the home/site url to punycode encoded domain name.