[support] url rewrite force www for multi-sites

Christina Callahan tina.callahan at UDel.Edu
Thu Jul 22 04:15:18 UTC 2010


I'm hoping to find a solution that hasn't presented itself after tons of 
searching...

I'm running four sites on one Drupal6 codebase.  The first site is the 
main portal site and the other three are subsites.  So - the base URL 
for each site are as follows:

http://example.com
http://example.com/site1
http://example.com/site2
http://example.com/site3

and the folder structure under /sites is:

example.com
example.com.site1
example.com.site2
example.com.site3

The sites are all reachable with this current setup, however, I'm 
experiencing some login issues that I believe are a result of the 
example.com and www.example.com being regarded as two different sites.  
I figured that all I needed a simple as modification to the .htaccess in 
the /drupal directory, however I'm not able to rewrite the URLs 
successfully for all my sites.

By modifying .htaccess to show

   RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
   RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]

I successfully redirect all of the pages on example.com to 
www.example.com, however example.com/site1, /site3, /site3 all get 
rewritten to www.example.com.

I've not found a situation documented about this, and I've tried a 
number of different alternatives that don't seem to work.

Any insights would be greatly appreciated.
Thanks!
Tina



More information about the support mailing list