[wp-trac] [WordPress Trac] #21143: Add a hook for when no blog is found (in addition to NOBLOGREDIRECT)

WordPress Trac wp-trac at lists.automattic.com
Tue Jul 3 01:20:45 UTC 2012


#21143: Add a hook for when no blog is found (in addition to NOBLOGREDIRECT)
--------------------------+-----------------------------
 Reporter:  jamescollins  |      Owner:
     Type:  enhancement   |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Multisite     |    Version:
 Severity:  normal        |   Keywords:  has-patch
--------------------------+-----------------------------
 (Related to #21142)

 '''Background'''

 On a multisite install, we allow users to change their subdomain name (or
 domain name).

 We keep a list of their previously used subdomains/domains, and if there
 is a HTTP request for one of their old domains, we automatically perform a
 301 redirect to the new domain name.

 '''Problem'''

 In order to perform a 301 redirect from and old domain to the new domain,
 we currently have to use wp-content/sunrise.php.

 However we would like to take advantage of the logic at the top of wp-
 includes/ms-settings.php, rather than re-inventing that logic in our
 sunrise.php file.

 The NOBLOGREDIRECT constant can be used for this, but it does not allow us
 to perform a 301 redirect.

 '''Solution'''

 Adding a simple hook to ms-settings.php would allow a sunrise.php file to
 determine what should happen if a HTTP request on a Multisite install does
 not correspond to one of the existing sites/blogs.
 See attached patch.

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


More information about the wp-trac mailing list