Multisite + Userdir

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

hi,
i have a multisite drupal install on the root of my domain. everything works fine.
i installed the usermod plugin for apache2. if i access mydomain.com/~user it works fine
i can install php over there without problem.
BUT...
if i install a fresh drupal install under mydomain/~user everything is then redirected to the root install...
exemple:
i want to access mydomain/~user/node/add
my url in the browser is mydomain/~user/node/add
but what i see is mydomain/node/add
not sure why it does that because if i install a fresh drupal install under a root'S subdir it works fine
exemple:
mydomain.com/drupal
any idea?
thanks for your help.
pht3k

Comments

Check .htaccess file

earthday47's picture

My first guess is that you should check the .htaccess file in your webroot. You may need to add an explicit statement to exclude the user dirs from being redirected by the base installation.

Try this:

edit your /.htaccess file and modify it like so:

# Let user dirs go through
RewriteCond %{REQUEST_URI} ^/\~(.)$ [NC]
RewriteRule .
- [S=1]

# Pass all requests not referring directly to files in the filesystem to
# index.php. Clean URLs are handled in drupal_environment_initialize().
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]

The - [S=1] means to skip the following rule. So if the URL has a tilde ~ in it, it will skip this .htaccess file's handling, and pass it off to /~user/.htaccess to do redirects.

If the ~ thing doesn't work, try using the actual directory name. So, ^/~user(.*)$ [NC] instead.

Maybe this will work for you. If not, I would suggest trying to set RewriteBase in /~user/.htaccess to /~user.

it works!

physiotek's picture

thanks a lot earthday47!!!
the root's .htaccess rewrite rules modification didnt work for me
but the ~user .htaccess rewrite rule trick

RewriteBase /~user

is working just perfect!!!
thanks again!
pht3k

Nice! Glad I could help.

earthday47's picture

Nice! Glad I could help.

Multisite

Group organizers

Group notifications

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

Hot content this week