I have a multi-site install I'm working on structured like this:

root site - www.example.com/drupal5
sub site - www.example.com/sub1

I can get to sub1 just fine, but when I click any of the navigation links, or log in, it redirects over to drupal5. When I mouse over the links it says "sub1/admin" but if I click it I go to "drupal5/admin".

I have the sub site directory set up as example.com.sub1 with the settings.php file in there like it's supposed to. I have tried setting the base url to sub1, and checked that htaccess is not redirecting somewhere.

Can somebody point me in the right direction as to what I could be looking for?

Thanks for you help.

-justin

Comments

WorldFallz’s picture

Did you do a complete install of the sub1 site? Is it completely separate from the drupal5 site or have you shared some of the tables?

===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime."
-- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz

unclejustin’s picture

Thanks for the quick reply!

I'm not sure what you mean by a complete install. They use seperate databases. I created a new db, then ran the install script on sub1 and it installed the tables itself if that's what you mean.

cog.rusty’s picture

Don't set the $base_url, to make it easier for the problem to show up when hovering.

I would keep looking for apache redirects. Do you have another .htaccess higher up in your web root? Or any rewrites for taking care of "www." or something else?

Any installed modules which do redirects or any multisite-related modules?

I guess you used a symlink for the second site?

unclejustin’s picture

Thanks for pointing me towards symlink. I'm running windows so we don't have "real" symlink, we have junction.

I'm going to document what I did here so in case anyone else runs into this problem they'll have the answer.

First download Junction from here http://www.microsoft.com/technet/sysinternals/FileAndDisk/Junction.mspx
I I saved the exe to right on the c: drive for easy access.

Then pull up cmd and get to the c: drive
Here you just type in "junction subdirectory drupalroot"

For example if you want www.example.com/sub1 and your drupal install is located at c:\www\drupal5 then you would type:
junction c:\www\sub1 c:\www\drupal5

Then following the documentation, create a directory under sites called www.example.com.sub1. Put your fresh settings.php file there and modify accordingly.

That worked for me and now my sub directories work perfect.

Thanks again cog.rusty

cog.rusty’s picture

So what was the problem? You were using a rewrite in .htaccess or a domain pointer to send them to the main Drupal installation, and the $base_url was concealing that the URL request had changed?