[wp-trac] [WordPress Trac] #36737: Single site reachable on multiple subdomains always redirected to site_url

WordPress Trac noreply at wordpress.org
Fri Feb 10 01:10:05 UTC 2017


#36737: Single site reachable on multiple subdomains always redirected to site_url
-------------------------------------+------------------------------
 Reporter:  jsoft                    |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Canonical                |     Version:  4.5
 Severity:  normal                   |  Resolution:
 Keywords:  reporter-feedback close  |     Focuses:
-------------------------------------+------------------------------
Changes (by SergeyBiryukov):

 * keywords:   => reporter-feedback close


Comment:

 Hi @jsoft, welcome to WordPress Trac!

 > We run a site which is reachable by multiple subdomains (nb. not
 multisite) For example customer1.site.nl, customer2.site.nl.

 Could you provide some more details of your setup? Are there any filters
 used to modify the site URL on the fly?

 > Since a recent update this stopped working. The visitor is always
 redirect to the site url www.site.nl.

 That's the exact purpose if canonical redirects, I don't see a bug here.

 Here's the snippet I generally use in `wp-config.php` to make a site
 available from multiple domains and avoid unwanted redirects to the
 primary domain:
 {{{
 define('WP_HOME',  "http://{$_SERVER['HTTP_HOST']}");
 define('WP_SITEURL', "http://{$_SERVER['HTTP_HOST']}");
 }}}

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


More information about the wp-trac mailing list