+4  A: 

Use revision control such as Subversion. Have one configuration file deployed to your test environment and a modified version checked out in your development environment. Simply tell your client to not commit those configuration changes so they don't make it to your testing/production environment.

This is definitely the best practice solution :)

P.S. If you don't feel like setting up a Subversion server, there's always hosted solutions like Beanstalk and if you're on Windows, TortoiseSVN is a slick client.

Dolph
+1  A: 

If you don't feel like setting up subversion you can always detect what site you're on by looking at SERVER_NAME. In a CI site in the past I used the following within my config.php to figure out dev vs production servers:

if ($_SERVER['SERVER_NAME'] == 'www.mysite.com') {
    $config['log_path'] = '/var/log/site/';
} else {
    $config['log_path'] = '/var/log/dev_site/';
}

You can use this anywhere you need to have different variables based on environment. That being said hard-coding stuff like this into your code isn't always the best idea.

Parrots
A: 

Here's a nice clean solution to running multiple production environments on a single codebase:

http://philsturgeon.co.uk/news/2009/01/How-to-Support-multiple-production-environments-in-CodeIgniter

Phil Sturgeon