I've developed my site locally and now need to migrate to staging. The Home page is displaying correctly so I would assume that a database connection is not the issue. But requesting {staging_url}/{any_segment}
results in a 500 Internal Server error.
Here I'm setting the environment in index.php
:
if (substr($_SERVER['SERVER_NAME'], -strlen('.dev')) === '.dev') {
define('CRAFT_ENVIRONMENT', 'development');
} else if ($_SERVER['SERVER_NAME'] == 'staging.blah.com') {
define('CRAFT_ENVIRONMENT', 'staging');
} else {
define('CRAFT_ENVIRONMENT', 'production');
}
Here's my general.php
:
return array(
'*' => array(
'extraAllowedFileExtensions' => 'vcf',
'omitScriptNameInUrls' => true,
),
'development' => array(
'devMode' => true,
'siteUrl' => 'http://blah.dev',
'environmentVariables' => array(
'baseUrl' => 'http://blah.dev',
),
),
'staging' => array(
'siteUrl' => 'http://staging.blah.com',
'environmentVariables' => array(
'baseUrl' => 'http://staging.blah.com',
),
),
'production' => array(
'siteUrl' => 'http://blah.com',
'environmentVariables' => array(
'baseUrl' => 'http://blah.com',
),
),
);
if (substr($_SERVER['SERVER_NAME'], -strlen('.dev')) === '.dev' !== FALSE)
isn't valid PHP syntax.