Covering both "www.domain.com" and "domain.com" in config file settings How can I cover both "www.domain.com" and "domain.com" with the same settings in my config file? My current file is set up like this:

return array(
    '*' =&gt; array(
       // Settings here
    ),

    // Local
    'domain.dev' =&gt; array(
       // Settings here
    ),

    // Staging
    'staging.domain.com' =&gt; array(
        // Settings here
    ),

    // Production
    'www.domain.com' =&gt; array(
       // Settings here
    )
);


Can I just remove the www from the last entry under “Production” to have those settings apply to both the naked domain and the www subdomain?

And if I'm including the www in my siteUrl config setting in Production, will that create any conflicts if visitors end up at a naked url without the www subdomain specified?

Thanks!
What I like to do is explicitly set CRAFT_ENVIRONMENT in my index.php:

switch($_SERVER['SERVER_NAME']) {
  case 'domain.dev':
    define('CRAFT_ENVIRONMENT', 'LOCAL');
    break;
  case 'staging.domain.com':
    define('CRAFT_ENVIRONMENT', 'STAGING');
    break;
  case 'www.domain.com':
  case 'domain.com':
    define('CRAFT_ENVIRONMENT', 'PRODUCTION');
    break;
}


Then in the config file:

return array(
  '*' =&gt; array(
    // Settings here
  ),
  'LOCAL' =&gt; array(
    // Settings here
  ),
  'STAGING' =&gt; array(
    // Settings here
  ),
  'PRODUCTION' =&gt; array(
    // Settings here
  )
);


When you set CRAFT_ENVIRONMENT you may want to use the switch default for LOCAL or for PRODUCTION - there are good arguments for going either way.

A separate question is whether you should have people accessing your site at both www.domain.com and domain.com. The answer is most probably no. Pick one, and use .htaccess (on apache) or whatever other method, to redirect either all the www to non-www or the other way around. Otherwise you will have duplicate content, which confuses the search engines (and generally looks unprofessional).