title: Website automatically changing URL to dev/production server
body: <p>I have inherited a webapp that I am trying to get set up locally on my work PC with Xampp, Codeigniter &amp; Netbeans.</p>
  
  <p>I have the project imported successfully into netbeans and can hit the run button and it opens in the browser. However I have some odd behaviour and I don't really understand what I am doing wrong.</p>
  
  <p>The index.php has the line:</p>
  
  <pre><code>define('ENVIRONMENT', 'development');
  </code></pre>
  
  <p>and then within the codeigniter application folder there is a development folder which has a config.php. This has the base_url set which is currently set to point at the dev server ("<a href="http://exampleDevServer" rel="nofollow">http://exampleDevServer</a>")</p>
  
  <pre><code>$config['base_url'] = 'http://exampleDevServer"';
  </code></pre>
  
  <p>I have changed this line so that it points to the xampp server on localhost, i.e. </p>
  
  <pre><code>$config['base_url'] = $config['base_url']   = 'http://127.0.0.1/';
  </code></pre>
  
  <p>When I press the run button it looks like it breifly goes to that server then straight away gets redirected to <a href="http://exampleDevServer" rel="nofollow">http://exampleDevServer</a>.</p>
  
  <p>There is a .htaccess file which has the following:</p>
  
  <pre><code>RewriteEngine on
  RewriteCond %{HTTP_HOST} !^http://exampleDevServer$ [NC]
  RewriteRule ^(.*)$ http://exampleDevServer/$1 [L,R=301]
  RewriteCond $1 !^(index\.php|resources|robots\.txt)
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php/$1 [L,QSA]
  </code></pre>
  
  <p>I have tried with both rewrite on and off with no effect.</p>
  
  <p>What I would like to happen is that when I am developing locally it is run from the xampp server and then I can change the define to production (or whatever) and then it points to the write place. What do I need to change in the above to fix this?</p>