My site is multi-domain site using oa_domains module (in openatrium). All web is under SSL no exception.

Without SSL it works very well (multi-domain or single domain). Configured as https://www.drupal.org/node/2265627 (#4)

To be under SSL, With one domain setting, besides modification in .htaccess (redirect http -> https), I also add base_url to be https ://www.domain.com. This works well (if I dont set base_url there are ssl mix content issue).

My problem is that Now I need to configure multi-domain using oa_domains module+SSL, I cannot use base_url anymore (for make SSL work), since the domains are different.

I was thinking to use if statement in settings.php. but some documents say that I should do with directories for different domains.

I then add sites/domain1.com and sites/domain2.com and copy the settings.php to both places but change them with different base_urls. However, it still does not work (errors, page not found, or cannot access the images of theme, plus lots of http:// in the script).

Can I use if statements in settings.php? how to know the current domain name?

Thanks.

Comments

hosais’s picture

Issue summary: View changes
hosais’s picture

OK, finally there is no more errors.

I just put

$host = $_SERVER['HTTP_HOST'];
$base_url = 'http://'.$host;

for setting $base_url and

then create symbolic link that domain2.com -> domain1.com.

That's it!.

hosais

hosais’s picture

Status: Active » Closed (fixed)
mpotter’s picture

Using different directories for sites is the way core Drupal handles multisites. When using Open Atrium with the oa_domains App you do not need to do this. But I don't see how putting "http" in the base_url would work if you are supposed to be using ssl. Shouldn't that be https?

hosais’s picture

Hi Mike,

Yes, my mistake, it should be https.

About the multisites setting, I tried to move to ./default.

If /default then it would be like in the following: (although I dont know why)
www.domain1.com and www.domain2.com will go to the same home front page.

If /domain1.com then
www.domain1.com -> normal oa2 home
www.domain2.com -> www.domain2.com space. <-- this one is better to me since it is more "separated" the two domain.

Actually I have few issues about oa_domain settings, but it is not related to SSL, so I created a new post here https://www.drupal.org/node/2400141

Note: in the original setup, my installation was drupal multidomain setup (even it had only one domain). I prepared to have multiple domains before.

hosais