How to: Redirect users to a given site when the visited subdomain does not exist in a WordPress Multisite deployment

How to: Redirect users to a given site when the visited sub-domain does not exist in a WordPress Multisite deployment

Now, this is a tricky one and I say that because I searched and couldn’t find the answer and I know it is out there! Perhaps I need to word my search better. Anyway, for those who deploy a multisite WordPress installation you probably have come across the following: If you have opened registration (options Logged in users may register new sites or Both sites and user accounts can be registered) then users can register a non-used subdomain to deploy their site.If, however, you have registration closed (Registration is disabled or User accounts may be registered) then the user comes across a default message that reads:

Greetings Site Administrator!

You are currently allowing “none” registrations. To change or disable registration go to your Options page.Registration has been disabled.

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.

To hide that message you must edit your wp-config.php file and add the following definition:

define( ‘NOBLOGREDIRECT’, ‘’ );

You can select whichever URL you prefer. So, say for example that you have created a page to let users know to email you if they want to register that site, you could do so this way.

If you wish to install support for multiple domains please visit this link: How to: Map your WordPress blog to multiple domains?

To deploy other languages to your Multisite please visit this link: How to: Add additional languages to your wordpress installation – Multisite Multinetwork localization

Enhanced by Zemanta

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: