I've imported a craft install and its database from a production site to make some changes to it. I've set it up to work locally in MAMP but whenever I go to example.local it keeps redirecting me to example.com. I'm using a multi-environment config so I'm not sure where it could be going wrong.
return array(
// Applies to all enviroments
'*' => array(
// Base site URL
'siteUrl' => null,
// Environment-specific variables (see https://craftcms.com/docs/multi-environment-configs#environment-specific-variables)
'environmentVariables' => array(),
// Default Week Start Day (0 = Sunday, 1 = Monday...)
'defaultWeekStartDay' => 0,
// Enable CSRF Protection (recommended, will be enabled by default in Craft 3)
'enableCsrfProtection' => true,
// Whether "index.php" should be visible in URLs (true, false, "auto")
'omitScriptNameInUrls' => 'auto',
// Control Panel trigger word
'cpTrigger' => 'admin',
// Dev Mode (see https://craftcms.com/support/dev-mode)
'devMode' => false,
// Preserve Image’s Colour Profiles
'preserveImageColorProfiles' => true
),
// Applies just to local dev server
'.local' => array(
// Site URL
'siteUrl' => "http://example.local:8888/",
// Devmode
'devMode' => true,
// Turn off timeout
'userSessionDuration' => false,
// Image assets paths
'environmentVariables' => array(
'basePath' => '',
'baseUrl' => 'http://example.local:8888/',
)
),
// Applies to production site
'.com' => array(
// Site URL
'siteUrl' => "http://example.com/",
// Devmode
'devMode' => false,
// Image assets paths
'environmentVariables' => array(
'basePath' => '',
'baseUrl' => 'http://example.com/',
)
)
);
And my current .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
# Send would-be 404 requests to Craft
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
RewriteRule (.+) index.php?p=$1 [QSA,L]