Currently, NoSuchWiki relies on an HTTP_REFERER to be set - this shouldn't be relied on to pass a subdomain to NSW because half the time it'll be empty or non-existent as HTTP_REFERER is often stripped or not set by privacy tools/browsers and doesn't help us if the user is coming directly or from a non-ShoutWiki site.
The solution would appear to be to piggyback off the (untidy) logic already present in LocalSettings.php and combine $lang.$sub where necessary (probably in a new variable?) and feed users to Special:NoSuchWiki/$lang.$sub. This would then make it relatively easy to find a log entry if it exists, check if a wiki already exists and feed there and if it doesn't, show the page without log entries. It also kills our need to have an additional million and two lines of request / wiki handling.