title: mod_rewrite and routing to code igniter
body: <p>I have been using code igniter as a subdirectory of a site and have several instances of if on one server.  Each instance is considered a separate application, but all under the same domain name.  I am looking to enable a slightly different URL structure though and have turned to mod_rewrite to help me out.</p>
  
  <p>The page is reachable at http://localhost/test but I want to rewrite that URL to appear as http://localhost/en-US/test.</p>
  
  <p>The problem is I keep getting a code igniter (CI) 404.  I can confirm the mod_rewrite is reaching the CI index.php, but CI is failing to deliver the correct page.  Here's and example setup:</p>
  
  <p>1) <a href="http://ellislab.com/codeigniter" rel="nofollow">Download a new instance of CI</a> and place it in a subdirectory in the site root.  Name the CI folder "test".  It should be reachable now on a local server at http://localhost/test and you should see the default welcome view.</p>
  
  <p>2) Create a .htaccess file in the server's root web directory. DO NOT place it in the CI "test" directory.  Add the following lines to it.</p>
  
  <pre><code>RewriteEngine On
  RewriteBase /
  RewriteRule ^en-US/test/?$ test/index.php [NC,L]
  </code></pre>
  
  <p>From my understanding of mod_rewrite, this should allow the URL http://localhost/en-US/test to render what is located at http://localhost/test.  It doesn't though.  I just get the CI version of a 404.  I need help figuring out how to resolve this.</p>