Static page on main domain and Drupal on subdomain In my installation, I'm utilizing Drupal's awesome capability to run on multiple subdomains using one code base. Each subdomain has its own database. So, I only need to have a static page on the main domain (root) but Drupal running on subdomains.

How do I do that? I know that I could modify the .htaccess file to make it look up for index.html first, but that would affect the subdomains.

Thanks.
You can solve this one using a RewriteRule in your .htaccess file. What you basically will do is check if the request is destined for your main domain (both with and without the www), and if so, tell Apache to go fetch the files from somewhere else. All this is done on the server-side, so the browser doesn't see a thing about this.

For the example below, I assume that Drupal is installed in /var/www. If it's installed somewhere else, update all occurrences of /var/www below.


Create a new directory /var/www/static_main_domain. This directory will contain the static content of your main domain.
Add the following lines of code to your .htaccess file (preferably immediately behind   the RewriteEngine On):



      # Check if the request is destined for www.yourdomain.com OR
      RewriteCond %{HTTP_HOST} ^www\.yourdomain\.com [NC,OR]
      # Check if the request is destined for yourdomain.com
      RewriteCond %{HTTP_HOST} ^yourdomain\.com [NC]
      # If so, go get the requested files from the static_main_domain subdirectory.
      RewriteRule ^(.*)$ static_main_domain/$1 [L,QSA]


For more info, check this: http://httpd.apache.org/docs/current/mod/mod_rewrite.html