We're trying to redirect a subdomain to a multisite install on an Amazon EC2 Server. The initial redirect worked like a champ -- it went to the raw IP and we created a directory in sites (sites/ matching the IP address.

So, now we're trying to do "Masked Subdomain Forwarding" from godaddy.com and it isn't working. It is always resolving to the raw IP address directory. We've done:

  • Created the matching subdirectory: (demo2.kcl.com)
  • Created a separate database for the new site
  • Modified settings.php to access said database

The directory listing:

drwxrwxrwx 6 bitnami daemon  4096 Feb  7 02:20 .
drwxr-x--- 9 bitnami daemon  4096 Jan 27 22:13 ..
drwxrwxrwx 3 bitnami daemon  4096 Jan 29 12:39
drwxrwxrwx 5 bitnami daemon  4096 Feb  2 07:53 all
drwxrwxrwx 3 bitnami daemon  4096 Jan 29 12:36 default
-rwxrwxrwx 1 bitnami daemon  2365 Jan 16 21:45 example.sites.php
drwxr-xr-x 3 bitnami daemon  4096 Feb  7 04:06 demo2.kcl.com
-rwxrwxrwx 1 bitnami daemon   904 Jan 16 21:45 README.txt

If I'm reading the documentation correctly, this should work but it is not. As I said, it simply resolves back to the raw IP address.

Any solutions or even just things to check would be greatly appreciated.

Thanks in advance!


(NOTE: IP and domain names have been changed to protect the ... spammable.)

1 Answer 1


From the looks of your folder structure you're missing the most important file for a multisite install...sites.php.

Copy example.sites.php to sites.php, edit it to add all sites in the installation to their respective paths, and try again...it should work.

These are the code samples example.sites.php for convenience:

// URL: http://dev.drupal.org
$sites['dev.drupal.org'] = 'example.com';

// URL: http://localhost/example
$sites['localhost.example'] = 'example.com';

// URL: http://localhost:8080/example
$sites['8080.localhost.example'] = 'example.com';

// URL: http://www.drupal.org:8080/mysite/test/
$sites['8080.www.drupal.org.mysite.test'] = 'example.com';

The format is:

'<port>.<domain>.<path>' => 'directory'
  • Wow, Clive. I almost knocked myself over with a face palm. Per your suggestion, I added in the sites.php and made sure they were being addressed correctly. But no luck, there, either! I very much appreciate the catch, though. The problem persists.
    – KCL
    Commented Feb 7, 2013 at 15:58
  • OK. I'm sure there's an answer to my original question but after some noodling, it became apparent that we could get the client to throw out the "masked subdirectory forwarding" notion and simply go with an subdomain A record. And that worked like a champ. Thanks again for that catch, Clive. Wouldn't have worked anyway before.
    – KCL
    Commented Feb 7, 2013 at 18:57
  • No worries, I'm working on a multisite as we speak to it's fresh in the mind! Glad you got it sorted
    – Clive
    Commented Feb 7, 2013 at 18:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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