Scenario:
I have a Drupal Installation which I run many sites from and this would be fine if each site has it's own Domain Name (FQDN). Normally I would just park the domain in my cPanel and create a folder /sites/example.com
The problem with subdomains in cPanel is that when creating a subdomain a new directory is created in my Drupal root for the subdomain and this is where i'm supposed to put the site. This would be fine if i was building a static site but I WANT IT TO BE A DRUPAL MULTI SITE site.
Solution:
This only works with TLD's: If you go to 'park a domain' and enter your new subdomain, providing you've already parked the TLD domain a new domain is parked (your subdomain)
Thus you can now go to the drupal /sites/ and create a new directory called subdomain.example.com and set up the new site as normal.
Update:
Another solution is to create a subdomain in cPanel, remove the directory created by cPanel and symbolic link the directory instead. If you don't have ssh access add
ln -s /path/to/your/html /path/to/your/html/subdomain
to a cron-job or
<br />
<?php<br />
symlink( 'target', 'link' );<br />
?>
Post new comment