Local MAMP site keeps redirecting to live production site 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
'*' =&gt; array(

    // Base site URL
    'siteUrl' =&gt; null,

    // Environment-specific variables (see https://craftcms.com/docs/multi-environment-configs#environment-specific-variables)
    'environmentVariables' =&gt; array(),

    // Default Week Start Day (0 = Sunday, 1 = Monday...)
    'defaultWeekStartDay' =&gt; 0,

    // Enable CSRF Protection (recommended, will be enabled by default in Craft 3)
    'enableCsrfProtection' =&gt; true,

    // Whether "index.php" should be visible in URLs (true, false, "auto")
    'omitScriptNameInUrls' =&gt; 'auto',

    // Control Panel trigger word
    'cpTrigger' =&gt; 'admin',

    // Dev Mode (see https://craftcms.com/support/dev-mode)
    'devMode' =&gt; false,

    // Preserve Image’s Colour Profiles 
    'preserveImageColorProfiles' =&gt; true

),

// Applies just to local dev server
'.local' =&gt; array(
    // Site URL
    'siteUrl' =&gt; "http://example.local:8888/",

    // Devmode
    'devMode' =&gt; true,

    // Turn off timeout
    'userSessionDuration' =&gt; false,

    // Image assets paths
    'environmentVariables' =&gt; array(
        'basePath' =&gt; '',
        'baseUrl'  =&gt; 'http://example.local:8888/',
    )
),

// Applies to production site
'.com' =&gt; array(
    // Site URL
    'siteUrl' =&gt; "http://example.com/",
    // Devmode
    'devMode' =&gt; false,

    // Image assets paths
    'environmentVariables' =&gt; array(
        'basePath' =&gt; '',
        'baseUrl'  =&gt; 'http://example.com/',
    )
)
);


And my current .htaccess

&lt;IfModule mod_rewrite.c&gt;
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]
There was a rule in my .htaccess to remove www that was redirecting to the live production site. Once I removed that I needed to delete my browser cache.