2

On my server I have drupal with a multisite sub-directory set up (example.com/www.site1.com), and do not use default for anything. However, when i go to default (example.com), I am sent to the default install.php (example.com/install.php).

How could I best prevent this from happening, and for example, show a custom index.html page when a user lands on just example.com?

  • Do you use multisite with single MYSQL Database or many? – Stone Vo Aug 26 '13 at 14:58
  • separate database for each site – petergus Aug 28 '13 at 7:49
3

You can't have an index.html in the root of your default directory, Drupal doesn't treat these directories like normal web folders. If you want example.com to go to a folder with a plain index.html file in it, you're going to need to edit your vhosts configuration. Right now, your vhost file probably looks something like this:

<VirtualHost *:80>
  ServerName example.com
  ServerAlias www.site1.com, www.site2.com, www.site3.com
  DocumentRoot /var/www/YOURDOCROOT
...etc

What this is doing is redirecting all sites that match either the server name or server alias and sending them to the DocumentRoot folder specified. When it gets there, Drupal tries to map the http requests to the appropriate folder but finding none for example.com, it sends it to the default directory instead.

If you want it to go to a single-page index.html, you are going to have to remove example.com from your vhost above and setup a new one, pointing example.com to that new folder, ex.

<VirtualHost *:80>
  ServerName example.com
  DocumentRoot /var/www/EXAMPLECOMDOCROOT
...etc

and place your index file in there.

If instead you want Drupal to send all traffic to one of your subsites, you can try either of these two methods:

  1. Remove the default directory (assuming there is nothing in there you want) and symlink it to the site directory you want it to be using instead, ex. if you want it to be pointing to site1

    ln -s www.site1.com default

  2. You could also point your primary domain there as well using symlinks, ex:

    ln -s www.site1.com example

  • Thanks, but in this case I want the default (www.example.com) to just be a blank page, or specifically, 'index.html'. – petergus Aug 28 '13 at 7:52
  • so not a drupal site then? that's an apache problem not a drupal issue. I've updated the answer above. – schnippy Aug 28 '13 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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