? domain_request.patch
Index: domain.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain.module,v
retrieving revision 1.40.2.18
diff -u -p -r1.40.2.18 domain.module
--- domain.module	1 Aug 2008 15:21:14 -0000	1.40.2.18
+++ domain.module	11 Aug 2008 16:25:04 -0000
@@ -56,7 +56,14 @@ function domain_init() {
   // If return is -1, then the DNS didn't match anything, so use defaults.
   if ($_domain == -1) {
     $_domain = domain_default();
+    // If the request was not for the primary domain, send the user there.  See http://drupal.org/node/293453.
+    if ($_subdomain != $_domain['subdomain']) {
+      $request = domain_get_uri($_domain);
+      drupal_set_message(t('You have followed an incorrect link to this website.  Please update your links and bookmarks to <a href="!url">!url</a>.', array('!url' => $request)));
+      drupal_goto($request);
+    }
   }
+  
   // If we stripped the www. send the user to the proper domain.  This should only
   // happen once, on an inbound link or typed URL, so the overhead is acceptable.
   if ($raw_domain != $_subdomain) {
