0

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.

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.

hosais
  • 164
  • 1
  • 1
  • 10

1 Answers1

0

I just put

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

for setting $base_url (settings.php) and

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

That's it!.

hosais

hosais
  • 164
  • 1
  • 1
  • 10
  • There a little mistake here. $base_url = 'http://'.$host; should be https. => $base_url = 'https://'.$host; – hosais Jan 20 '15 at 11:21