[wp-trac] [WordPress Trac] #23088: Multisite, Subdomains and www

WordPress Trac noreply at wordpress.org
Sun Dec 30 20:05:34 UTC 2012


#23088: Multisite, Subdomains and www
-----------------------------+--------------------------
 Reporter:  jkhoffman        |       Type:  defect (bug)
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  General
  Version:  3.5              |   Severity:  normal
 Keywords:                   |
-----------------------------+--------------------------
 I installed a WordPress Multisite network (in subdomain mode) on Zend's
 PHPCloud.com.

 Zend does not provide an IP address, recommending a CNAME instead. CNAME
 records are not allowed on the root of a domain, so they recommend using
 the www subdomain, with a redirect from the root domain to www.

 This site can NEVER be accessed on the naked domain; it will always be
 accessed via the www subdomain.

 So, I setup wildcard DNS for *.mydomain.com, then created a network on
 www.mydomain.com. Then, I went to a non-existant subdomain on my network,
 nonexistant.mydomain.com, and WordPress redirected to www.mydomain.com/wp-
 signup.php?new=nonexistantwwwmydomaincom.

 The correct behavior is to redirect to www.mydomain.com/wp-
 signup.php?new=nonexistant

 The fix for this is in wp-includes/ms-settings.php, replace line 89 with:

 {{{
 $site_domain = preg_replace( '|^www\.|', '', $current_site->domain );
 $destination = 'http://' . $current_site->domain . $current_site->path .
 'wp-signup.php?new=' . str_replace( '.' . $site_domain, '', $domain );
 }}}

 Also, on the registration page at the bottom it says:

 "The site you were looking for, http://nonexistant.www.mydomain.com/ does
 not exist, but you can create it now!"

 The fix is in ms-blogs.php, line 53:

 {{{
 $url = preg_replace( '|^([^\.]+://)(?:www\.)?|', '$1' . $blogname . '.',
 $url );
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23088>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list