Redirecting domains to a WordPress Multisite

Redirecting domains to a WordPress Multisite is slightly more complicated that I would have expected. WordPress checks what referrer you’re coming from when using WPMU (which totally makes sense, so it can know what multisite blog you’re wanting), but when it finds a URL that it doesn’t recognize, things go down the tube, quick..

WordPress is fantastic, but there are some things hidden under rocks that you rarely know about until you need it. Today I needed to point an clients’ old domain to their new website! The problem was, WordPress was using it’s logic of “That domain doesn’t exist here, they must want to register it as a new blog!”, which is totally wrong. (Good thinking though, WordPress!)

We have new blog registration disabled. When I was looking at this setting, I noticed a small note below.

If registration is disabled, please set NOBLOGREDIRECT in wp-config.php to a URL you will redirect visitors to if they visit a non-existent site.

Good to know! This means we can actually stop that pesky “Registration is disabled” page from coming up without using any plugins! Just go into your wp-config.php file and direct any non-recognized URLs to any URL (in most cases, the new site’s URL).

define( 'NOBLOGREDIRECT', 'http://ericholmes.ca/' );

Now we can start redirecting domains to a WordPress Multisite with no more interference!

WP on!