Add a hook for when no blog is found (in addition to NOBLOGREDIRECT)
|Reported by:||jamescollins||Owned by:|
(Related to #21142)
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.
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.
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.