mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 15:08:10 +01:00
Canonical now only redirects to a different domain if the domains differ by their yes-www/no-www status. fixes #5089
git-svn-id: http://svn.automattic.com/wordpress/trunk@9646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7ab338d7f8
commit
dbb012bdaf
@ -238,7 +238,9 @@ function redirect_canonical($requested_url=null, $do_redirect=true) {
|
||||
$redirect['path'] = trailingslashit($redirect['path']);
|
||||
|
||||
// Ignore differences in host capitalization, as this can lead to infinite redirects
|
||||
if ( strtolower($original['host']) == strtolower($redirect['host']) )
|
||||
// Only redirect no-www <=> yes-www
|
||||
if ( strtolower($original['host']) == strtolower($redirect['host']) ||
|
||||
( strtolower($original['host']) != 'www.' . strtolower($redirect['host']) && 'www.' . strtolower($original['host']) != strtolower($redirect['host']) ) )
|
||||
$redirect['host'] = $original['host'];
|
||||
|
||||
$compare_original = array($original['host'], $original['path']);
|
||||
|
Loading…
Reference in New Issue
Block a user