diff --git a/wordpress/wp-includes/canonical.php b/wordpress/wp-includes/canonical.php
index f75a72e..3a8b174 100644
a
|
b
|
function redirect_canonical( $requested_url = null, $do_redirect = true ) { |
70 | 70 | if ( false === $original ) |
71 | 71 | return; |
72 | 72 | |
| 73 | $site = @parse_url(get_site_url()); |
| 74 | |
73 | 75 | // Some PHP setups turn requests for / into /index.php in REQUEST_URI |
74 | 76 | // See: https://core.trac.wordpress.org/ticket/5017 |
75 | 77 | // See: https://core.trac.wordpress.org/ticket/7173 |
… |
… |
function redirect_canonical( $requested_url = null, $do_redirect = true ) { |
77 | 79 | // $original['path'] = preg_replace('|/index\.php$|', '/', $original['path']); |
78 | 80 | |
79 | 81 | $redirect = $original; |
| 82 | // enforce the same host as site_url to not break CDN setups |
| 83 | $redirect['host'] = $site['host']; |
| 84 | |
80 | 85 | $redirect_url = false; |
81 | 86 | |
82 | 87 | // Notice fixing |
… |
… |
function redirect_canonical( $requested_url = null, $do_redirect = true ) { |
422 | 427 | // Only redirect no-www <=> yes-www |
423 | 428 | if ( strtolower($original['host']) == strtolower($redirect['host']) || |
424 | 429 | ( strtolower($original['host']) != 'www.' . strtolower($redirect['host']) && 'www.' . strtolower($original['host']) != strtolower($redirect['host']) ) ) |
425 | | $redirect['host'] = $original['host']; |
| 430 | $redirect['host'] = $site['host']; |
426 | 431 | |
427 | 432 | $compare_original = array( $original['host'], $original['path'] ); |
428 | 433 | |