Take the 2-minute tour ×
ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. It's 100% free, no registration required.

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.

share|improve this question
    
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? –  Kim Wincent Wickell Dec 1 '12 at 23:46
    
I may have confused myself there. Will need to go back and look. :) –  Angie Herrera Dec 2 '12 at 0:53
add comment

2 Answers

up vote 7 down vote accepted

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.

share|improve this answer
    
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. :/ –  Angie Herrera Dec 1 '12 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! –  Angie Herrera Dec 1 '12 at 21:01
    
Marked this as the answer - it was definitely a host issue. We were finally able to switch them. Thanks! –  Angie Herrera Jan 10 '13 at 4:21
    
Great! Glad to help! –  Erik Reagan Jan 10 '13 at 15:07
add comment

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.

share|improve this answer
    
Path is set correctly; site is actually running. –  Angie Herrera Dec 1 '12 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 Mar 11 '13 at 3:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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