I've been using Focus Lab's Master Config for most of this year and have never run into this issue before.

So here's what's happening, going to the domain (example: mysite.com/index.php or mysite.com) brings up a 500 internal server error. Going to mysite.com/admin.php does too. The .htaccess file is blank for the time being, but will eventually contain rules for removing index.php, expires, etc.

Going to www.mysite.com/index.php, www.mysite.com or www.mysite.com/admin.php all work. Going to subpages with www in front also seems to work fine.

My config.env.php file looks a little like this: http://pastie.org/5461257

If I change the first case to include the www, I get the 500 internal server error, AND the site shows correctly, including subpages.

If I throw the following into .htaccess (www to no www redirect) and keep the first case statement in config.env.php to include the www, the site works. If I change the case statement to just be mysite.com, the site does not work.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

Then, if I force www in .htaccess and keep www in config.env.php, the site doesn't work. If leave off www in config.env.php, the site works.

For now, just to get the site up and running, I've forced removal of www, left www in the config.env.php file, and added other rules to .htaccess (such as removing index.php, expires, etc.) and it's working fine.

I'm wondering if anyone has any insight as to why something like this would happen? I don't know that much about servers, but something tells me there's something funky with this client's host.

  • When you are using www.domain.com and the case in env-config is www.domain.com do you get a error500 AND the site works? The internal server error should force a shutdown? Commented Dec 1, 2012 at 23:46
  • I may have confused myself there. Will need to go back and look. :)
    – A Herrera
    Commented Dec 2, 2012 at 0:53

2 Answers 2


In cases like these it's likely that there is something unique about how the host sets certain environment variables within PHP.

A few questions:

  • Who is the host?
  • Do you have access to server error logs?
  • If so, what's in the error log?

If you have a 500 error you should have a log of the reason somewhere on the server. If there isn't, as your host where you can access that information. That will really help drill down to the source of the problem.

  • The host is some random company that I've never even heard of. We have limited access to server error logs via cPanel but nothing really stuck out (mostly just a bunch of 404s). Will definitely ask though and hope for a halfway decent response. :/
    – A Herrera
    Commented Dec 1, 2012 at 21:00
  • Also... My fault for not setting up the client with a better host in the first place. I don't even know how they ended up with this host. We're working on regaining control of their domain so we can switch them. Thanks for the tips though, much appreciated!
    – A Herrera
    Commented Dec 1, 2012 at 21:01
  • Marked this as the answer - it was definitely a host issue. We were finally able to switch them. Thanks!
    – A Herrera
    Commented Jan 10, 2013 at 4:21
  • Great! Glad to help! Commented Jan 10, 2013 at 15:07

In your index.php & admin.php are you pointing your system path to the correct spot?

I keep my system above root:

$system_path = '../system';

On a related note, can you turn on debugging in your index/admin files?

Earlier this week I had the same issue until I enabled debugging and got:

Your system folder path does not appear to be set correctly. Please open the following file and correct this: index.php

Then I promptly fixed the path and it worked.

  • Path is set correctly; site is actually running.
    – A Herrera
    Commented Dec 1, 2012 at 20:58
  • Hey @Paulo, I am getting the same error "Your system folder path does not appear to be set correctly." however I have tried both the variations listed in the docs with no success eg. $system_path = '../site1.com.au/system/'; and $system_path = 'site1.com.au/system'; Any thoughts?
    – Dan
    Commented Mar 11, 2013 at 3:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.