0

I have a multi site setup to which I have placed

define( 'NOBLOGREDIRECT', 'http://www.example.com' );

In the wp-config.php file

However when I visit a site which dose not exist (e.g. http://nosite.example.com) I'm greeted with the following

Error establishing a database connection

Instead of being redirected to the homepage as defined.

I have disabled all plugins and reverted back to the default .httaccess however this has not solved the issue.

How can I solve this and have a none existing subsites redirected to the appropriate location?

0

2 Answers 2

0

I am not sure if this will help you find your issue, but I believe that you should not have set up your multisite with www

Before_You_Create_A_Network States

While it's not recommended to use www in your domain URL, if you chose to do so and plan to use subdomains for multisite, make sure that both the site address and the WordPress address are the same. Also keep in mind some hosts will default to showing this sort of URL: nosite.www.example.com

0

This problem was solved by

replacing

 define('DOMAIN_CURRENT_SITE', '/');

with

define('DOMAIN_CURRENT_SITE', 'www.example.com');

Not the answer you're looking for? Browse other questions tagged or ask your own question.