Skip to Content

Our Favorite Tools

  Keep Updated via RSS
 -click here-

Enter email address here:

Your privacy is safe with us.

Creating a Sub-domain on Drupal Multisite

All my Drupal web-sites are built on a single installation of Drupal codes. This is commonly known as multisite configuration. One major advantage is that there is only one set of codes to worry about whenever it comes to site maintenance such as program upgrade etc. Those running more than just a handful of sites will appreciate this facility.

Having said that, all my sites above are top level domains. I have tried without success in the past to create sub-domain sites using the same multisite configuration above.

After so many months have passed, I decided to tinker with the idea again. Don't they say never ever give up eh?

It wasn't that straight forward either. I played around with creating sub-domain, domain redirection, creating special folders etc but still not getting what I wanted i.e. getting a sub-domain working and running under Drupal multisite.

When I was working with my top level domains, the trick was to "point" all domains to a root folder where Drupal was installed. This is achieved by using cPanel's "parked domain" tool. So I thought I may achieved the same result for sub-domains too.

With that concept in mind, I created a sub-domain and then set it up as a parked domain or rather parked sub-domain. I then run Drupal install with that sub-domain and... voila! a new site springs up to live. Sweet.

It’s Gone! But Start Anew

After running the site (sub-domain) for about 2 days, it went down for unknown reasons. I tried to delete the sub-domain and un-assign the parked domain but failed on both attempts. After a couple emails back and forth with my hosting, the domain got un-assigned.

I then deleted the sub-domain with the idea of starting anew. You'll see how this trouble actually helped to show me a much simpler way to run multisite Drupal using sub-domain.

This time around, I go straight creating an addon domain for the sub-domain without bothering to create the sub-domain first. This is done by going to cPanel's domain manager shown below:

Note: remember to replace all fictitious names I used through out this example with real ones.

Here Are The Steps:

  • Create an add-on domain by clicking "Add Domain" and then entering your sub-domain.

image

  • Enter your sub-domain details.

 

The next few steps are typical ones you would take to install any other Drupal sites.

  • Create a folder in /sites/”subdomain.com”/ and keep a copy of “settings.php” inside it.
  • In mySQL, create a database.
  • Edit Drupal "settings.php" to reflect your database details.
  • Initiate Drupal installation by entering "mysubdomain.domain.com/install.php" in your browser.
  • Proceed as usual.
  • Done.

Repeat all steps above for another sub-domain.

My sub-domain is still running smoothly until now and I did not expect anymore surprises this time :). I believe it was clear enough for you to follow easily. Leave me a comment if not.

Hope you enjoy it.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
15 + 4 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.