$mosConfig_live_site – the ‘www’ could be the difference
Recently Bluehost.com decided to apply a security update to the PHP version on our box. This would appear to be an uneventful occurrence and normally I wouldn’t have even taken notice (especially since I was on a one week vacation due to my son being born), but this update was a problem. Turns out something on our site conflict badly with it and rendered our site unreachable with a hefty 500 server error.
I would later find out it was a couple plugins we had installed that caused the problem, but by that time I had already started the long process of rebuilding and was too far in to turn back.
Anyway back to $mosConfig_live_site. In the process of trying to get our site back to where it had been before the update I started to have trouble with the clean URL’s. We are running the latest versions of Joomla!, Viertuemart and OpenSEF. Once the SEF URL’s were activate everything seemed to work ok until you hit the ‘checkout’ button on our store. Then somewhere in the SSL redirect things went wrong and it would end up dumping the cart contents and leaving the user stranded on a secure version of the home page. I puzzled over this for days, posted to a couple forums and lost some sleep.
Then it hit me. I noticed that the any relative links would redirect the user to the non-www version of the site. So for example: if you went to www.domain.com and then clicked on a link it would take you to domain.com/link-url/ rather than www.domain.com/link-url/. So I knew I had the root URL wrong somewhere, but the variable that determines that value ($mosConfig_live_site) I believe is set in the installation process and is not visible anywhere in the administrative side of Joomla. It’s located in the configuration.php file located in the installation root.
Sure enough I had set $mosConfig_live_site to http://domain.com rather than http://www.domain.com. I added the ‘www’ and the checkout process worked like a charm with the clean URL’s enabled.