Drupal 7 multi-site subdirectory wrong site

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
kdhartstrom's picture

I'm working on a Drupal 7 multi-site setup. I have the following:

mydomain.gov <- default site
mydomain.gov/department1 <- site1
mydomain.gov/department2 <- site2

I've created the appropriate folders in my sites folder, copied the default.settings.php file to each folder as settings.php and setup the new site.
mydomain.gov.department1
mydomain.gov.department2

When I visit mydomain.gov/ i get the default site, when I visit mydomain.gov/department1 i get that sites home page. However when I visit mydomain.ca.gov/department1/sub-page I get a not found message from my default site.

Why is my default site responding to requests for /department1/sub-page?

I've tried an apache alias (Alias /department1 /path/to/my_drupal_root). I've tried the symlink (ln -s . department1). I've tried a couple of apache re-write rules I found at http://drupal.org/node/365844 and http://drupal.org/node/1001080. I can get the home page of each site to load, however any children items I request always return a not found page from the default site.

This issues has some relation to clean url's. For example mydomain.gov/department1?q=sub-page pulls up the correct page, however mydomain.gov/department1/subpage returns a not found page from the default domain. Site1 and Site2 child pages load correctly if I turn clean-url's off. However that not a acceptable solution for us.

Comments

Bad Apache Config

kdhartstrom's picture

Finally figured this out:
A. The problem had everything to do with mod_rewrite rules.
B. The rules in my the drupal supplied .htaccess was not actually taking affect. I had to set AllowOverride All in my apache directory config for my root drupal directory.
C. I had an out-dated RewriteRule in my apache site.conf file, that came from drupal 6 or earlier, I commented out the re-write rules in my site.conf file.

Once the current drupal7 supplied .htaccess was actually taking effect, everything worked like it ought. I ended up using symlinks, not apache aliases for each sub directory site.

new to drupal

bharathiselvaraj's picture

Hello kdhartstrom.,
I am new to drupal.. Can you tell me all the steps for creating the multisite please.. Here is my Requirements...
sites:
multisite->main
multisite/site1
multisite/site2

Other Requirements:
WAMP-2,
Drupal 7,

Thanks in advance..
Bharathi

Multisite

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week