For instance, I first create a wildcard pointing *.example.com to my drupal installation. Then if I access nonexistantsite.example.com, drupal attempts to connect to a non existant database and throws up all the usual errors.

I think the module needs to first check if the database exists, and if it doesn't just forward to the site as usual.

Comments

kaerast’s picture

Title: Using a wildcard subdomain returns an error if there isn't a site with that name. » Multisite Manager should check if a site exists before loading it

This also happens for example.org/site/mysite, so it's not related to subdomains. From a brief look at the code I'd say Multisite_manager needs to check whether {shortname} exists.

schuyler1d’s picture

Category: bug » feature

This would be a good feature, but the main question would be what do you want it to do instead?

The implementation is a little more complicated, regardless, since this part isn't handled at all by the module, but the rewrite rules combined with the settings.php file. When the settings.php file is run, there is no access to the database, yet.

So, we could, in theory write to a file, with all the shortnames, and then read from it, but then what would it do? If it simply does not set the database to the non-existent shortname, then Drupal will give a slightly different error: no configuration available.

One possibility would be to default to the main site--maybe even to the create site screen?

kimadactyl’s picture

Either a "this site does not exist" or a redirect to front page would be suitable here I think! I also question this being a feature not a bug, but your call!