[support] url rewrite force www for multi-sites

Kevin Davison kevin at quevin.com
Thu Jul 22 05:40:46 UTC 2010


Did you get the information you used from http://drupal.org/node/93603 ?

This may be helpful: http://www.drupalcoder.com/story/205-drupal-multisite-in-subfolders

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

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

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

And it may be a good idea to create symlinks, as the page suggests.

K

On Jul 21, 2010, at 21:15 PM, Christina Callahan wrote:

> 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
> 
> -- 
> [ Drupal support list | http://lists.drupal.org/ ]



More information about the support mailing list