Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Secondary MSM site not working in ExpressionEngine

I'm having some trouble: I have an MSM-site, on both staging- and live-servers. I'm developing the secondary site, and have just moved to the live-server. Weird thing is it cannot connect to db. My bootstrapped config has this if-statement:

if($_SERVER['HTTP_HOST'] == 'www.domain.com' || $_SERVER['HTTP_HOST'] == 'en.domain.com')

This doesn't seem to evaluate properly, because ExpressionEngine can't load site preferences. So to test I've created a simple php file on the subdomain which just echoes $_SERVER['HTTP_HOST'], and that outputs en.domain.com. So why would this evaluate properly in vanille PHP but not in ExpressionEngine? Any thoughts?

like image 520
Steven Avatar asked Feb 18 '23 16:02

Steven


2 Answers

Ok we found the problem. Apparently this server wasn't too happy about the use of || (double pipe) as OR, so we put it in its own separate elseif statement and now its working.

like image 95
Steven Avatar answered Mar 12 '23 01:03

Steven


Whenever I have an issue like this, I put a die('Conig File'); to make sure that the config file is getting processed. You will obviously notice if the config file is being read or not. Once you can verify that it is being read, then you can move to figuring out why its not being processed.

like image 44
user814584 Avatar answered Mar 12 '23 02:03

user814584