I'm trying to setup a multisite install using sub-directories and I can't seem to get it to work.

I have drupal installed at my document root, let's call it mydomain.ca.

I've tried creating sites/mydomain.ca.site1, but when I go to mydomain.ca/site1/ it tries to use sites/default.

I've also tried creating sites/mydomain.ca/site1, but the same thing happens.

What am I doing wrong?

Comments

ivan zugec’s picture

Have you added a settings.php in "sites/mydomain.ca.site1"?

lambic’s picture

Yes I added a settings.php, copied from default_settings.php and made it world writeable

lambic’s picture

I was missing a crucial step, creating a symbolic link from /site1 to where drupal is installed, e.g.:

ln -s /var/www/html /var/www/html/site1

Should this be added to the multi-site installation guide?

the_source’s picture

What directory is that link?

Like made a new directory and copied the needed files in there:
/usr/share/drupal6/sites/thevortex.dyndns.info.tess

Below believe shows that my document root is /usr/share/drupal6/

cat /etc/apache2/conf.d/drupal6.conf
Alias /drupal6 /usr/share/drupal6


Options +FollowSymLinks
AllowOverride All
order allow,deny
allow from all

So where would I put this link? Just not getting it! :)

Help!
Craig

lambic’s picture

You can create the symbolic link in the document root (/usr/share/drupal6 in your case). However since posting this thread I've started doing things the Apache way instead. I was never comfortable with the symlink solution so I looked around for other options. Here's what I do now:

Create the site in drupal/sites/example.com.subdir

Modify apache config to add an alias to the VirtualHost entry:

Alias /subdir /path/to/drupal/

And rewrite rules to the directory:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/subdir/.*
RewriteRule ^(.*)$ /subdir/index.php?q=$1 [L,QSA]