Multiple Domains with one Drupal install - Part One of a series.
This is not another post about Drupal Multisites or Drupal Domains. This is about when you have 2 or more domains that need to use the same Drupal Install, Database, File Structure, User Accounts, ETC but need a different theme based on the domain in the address bar of the browser
I scoured the internet for over a week. I asked questions on IRC . I tested a few modules, I played around with redirects and the .htaccess file, still with not the solution I wanted. Here is an overview of what I am working with: Hosting: www.mediatemple.com (Grid Server - el-cheapo package) Main domain: www.climbcanada.com (Main Drupal 6.x svn Install here from Aqulia) Domain to Redirect: www.climbjasper.com The reason for doing this is that Users need the ability to signup, post comments on Content Types, Submit and Edit Content Types from both Domains. The difference is that the www.climbjasper.com will have different Theme and only show Jasper specific content. The URL needs to maintain the www.climbjasper.com as this site only relates to Jasper. www.climbcanada.com will have a its own theme and a different menu structure. The first step (as both these domains are on the same hosting package and this would only work this way), create sym links. I got my tutorial from the Media Temple knowledge base here: Pointing Multiple Domains to the Same Alternate Domain Folder. I tested this and it worked. The URL stayed the same in the address bar. WICKED. The second step - Will the php Global Server Variable $_SERVER['SERVER_NAME'] keep to the domain name in the address bar. (I was not sure if this would work or not.) It did work, YAY. This is a good sign because I can use this for php logic at the theme level. The third step was to use the Drupal module Theme Key. This can change themes based on the path. I know it is good for the path but I was not sure if you could based in the URL. After an install and test it only works on the path.... But there is another module for Theme Key called ThemeKey Properties. After installation I noticed you had to clear all the caches to see the options. I will not give the details on setup because the instructions work well. With this little add on module, I got different themes based on the Domain Name in the URL. The final step was to make Jasper specific nodes only editable by a specfic Role. I had used the Content Access module in the past with a large D5 project with alot of buggy issues. I re-tested this module with this D6 install with no luck to function how I wanted. I stumbled upon the Node Access Module. After a quick install and test, this worked perfectly on the node level. I have spent over 10 hours on the above issues with great success. The next post will discuss how to make multiple Node Referenced Select Lists on one Node Add Form, Dropdown Dependant with Jquery. chris











