Hi Guys!
i just set up an site (Drupal 5.2) width several multisites. These work flawless in the meantime if I'm using subdomains (http://sub.example.com/ via sites/sub.example.com/), however, if I'm using (sub-) folders (http://www.example.com/mysite/test/ via sites/www.example.com.mysite.test), the don't!
To be more precisely, I'ld like to have a URL http://www.example.com/mysite.test/ (width a dot), but it even doesn't work using a slash or just one directory. It always says 404 (not found), using the theme from the main site.
Clean URLs are activated all-over the setup, the sites/-directory has the following setup:
all/modulesthemes
default/(Symbolischer Link zuwww.example.com/)www.example.com/filesmodulesthemestmpsettings.php
sub1.example.com/filesmodules- ...
sub2.example.com/files...
www.example.com.mysite.test/files- ...
And upto the last directory works everything fine. This directory is a duplicate of one of the others (with a modified settings.php), so there shouldn't be an error.
For the sake of completeness my httpd.conf (stripped-down):
SuexecUserGroup "#1022" "#1023"
ServerName example.com
ServerAlias *.example.comDocumentRoot /home/example/public_html
ErrorLog /home/example/logs/error_log
CustomLog /home/example/logs/access_log combinedScriptAlias /cgi-bin/ /home/example/cgi-bin/
<Directory /home/example/public_html>
allow from all
AllowOverride None
<FilesMatch "(\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)|code-style\.pl|Entries.*|Repository|Root|Tag|Template)$">
Order allow,deny
</FilesMatch>
Options -Includes
Options -Indexes
Options +FollowSymLinks
ErrorDocument 404 /index.php
DirectoryIndex index.php
<IfModule mod_php5.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A1209600
ExpiresByType text/html A1
</IfModule><IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
</Directory><Directory /home/example/cgi-bin>
allow from all
</Directory>
Now my question: Why does it not work, and how can I make it so?
Regards,
Julius from Germany
P.S. I have to admit that this post has been also posted to the German Drupal forum, see http://www.drupalcenter.de/node/5670 for the German version ;-)
Comments
corrections, I'm sorry!
Ooops, to be correct: They work flawlessly, and "default/ (Symbolischer Link zu www.example.com/)" is meant to be default/ (symlink to www.example.com/). :-)
Did I miss the edit funktion?
Everything is working as it
Everything is working as it should ...!
When you visit http://www.example.com/mysite.test/, the web server is looking in subfolder mysite.test for index.php and cannot find it, -> 404 error.
In your main drupal directory you need to create a Symbolischer Link called mysite.test pointing to "."
To get http://www.example.com/mysite/test/ to work, you would need to create a subfolder mysite in your main drupal folder and in mysite create a Symbolischer Link called test pointing to ".."
gpk
----
www.alexoria.co.uk
PS Yes, you did miss the edit funktion!
gpk
----
www.alexoria.co.uk
Wow, now it works! Thank you
Wow, now it works! Thank you so much for your nice and quick answer!
Now there's only one more problem: Where is the edit function? ;-)
Julius
;-)
Does your :wink: mean that you were asking rhetorically?
If not, I think it’s next to add new comment though it disappears when someone has already replied.
Also, I don’t think your sites/default directory should link to the base of your site, It should have a settings.php for the multi-sites that don’t have their own directory in sites/.
Are symlinks needed or not?
Hi all,
There are a pletheroa of threads about multisite, subsites subfolders etc,
but this is the only one to come close to replicating my issue.
I have multisite working for Apache vhosts, with no problems
eg
test1.localhost
test2.localhost
However, as with the original poster, I have failed to get subfolder multisites working
eg
test1.localhost/subsite
I have created the folder
test1.localhost.subsite
I have included settings.php,
but I stilll get a 404.
As I understand it, I should not need to change DNS, Apache, .htaccess or anything like that.
The new folder with settings.php should suffice?
I'm running windows, Apache, Php5
If symlinks are needed, they can't be done on windows.
[junction points, the closest windows equivalent, is a pure mess]
It's not the end of the world if it can't be done... but I have followed the installation instructions to a t, to no avail.
http://drupal.org/getting-started/5/install/multi-site
Regards
Alan
Drupal development and themeing, Galway, Ireland
=-=
symlinks are needed as that is what will point to the drupal code base and scan the sites folder for a match based on where the symlink is being pointed from. Also of note, you state you shouldn't have to do anything to .htaccess but for a multisite in a subfolder you do indeed have to alter .htaccess according to the last paragraph of the documentation you link to.
I've never run a windows IIS system so I can't help any further.
_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )
Ok, lets update the handbooks!
Thanks VeryMisunderstood,
This is what I had anticipated, so lets get the docs, and the install.txt updated.
Something along the following lines needs to be added.
1. Under Windows, Multisite through subfolders is not supported.
2. To facilitate multisite through subfolders eg
www.example.com
www.example.com/test
as two different installations, an extra step is needed.
After creating the folder
www.example.com.test
and placing the settings.php file in that folder,
you now need to create a symlink
/* insert symlink instructions here */
Lastly, the handbook page, states that configuration of .htaccess is only required if clean URLs are desired.
Is that incorrect? Is it required in all cases for multisite in subfolders?
If so that needs to be updated too.
I'm not a member of the documentation team, so I'll open an issue for the docs if you aren't either.
Maybe an issue is best anyway so we can thrash out the wording?
Regards
Alan
Drupal development and themeing, Galway, Ireland
=-=
My reading of it is that for a multi site to work in a sub folder (I"ve only used subdomains) that you MUST enable clean urls and add those lines to a .htaccess file.
I don't have time to run through a test of this case, my multisite using subdomains work perfectly well. I"ve never seeen a need for a sub folder install.
With regards to symlink insrtuctions not all hosts are created equal and there are multiple ways to create a symlink including having your host do it.
_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )
Issue Opened
Thanks again,
Like I mentioned above, I have multiste via multiple domains working properly.
I wanted to have multisite via subfolder to facilitate easier testing.
I would like to be able to install a new drupal installation without messing with Apache and my hosts file.
It means I can test it from other PCs[ or macs] in my LAN easier.
But the reason for me wanting multisite via subfolders is neither here nor there.
I think I may have found a way around the symlinks, but editing apache config instead, but I haven't worked it out fully.
If i get it going, I'll report back and open an issue
Alan
Drupal development and themeing, Galway, Ireland
Yes this may be possible
Yes this may be possible using a bit of custom Apache configuration, possibly using the Alias directive http://httpd.apache.org/docs/1.3/mod/mod_alias.html.
Alternatively see this post http://drupal.org/node/176087 which has an example of someone creating "junctions" in Windows (the equivalent of a symbolic link to a directory in *nix). There are links to a command line tool for doing this and also a graphical tool.
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk