title: Why aren't my routes working in CodeIgniter?
body: <p>I have already read a bunch of the articles on stackoverflow about this topic, such as:</p>
  
  <p><a href="https://stackoverflow.com/questions/4362460/codeigniter-seo-friendly-urls">CodeIgniter: SEO friendly URLs</a> </p>
  
  <p><a href="https://stackoverflow.com/questions/8450614/codeigniter-routes-not-working-sometimes">Codeigniter routes not working sometimes</a></p>
  
  <p>And I swear I have set up everything correctly, but after I put the route in and save my app, and attempt to go to the new URL, or even the old one, they both give me a 404 error.</p>
  
  <p>I have an extension that currently looks like this:</p>
  
  <p><strong>search/map_view/county</strong></p>
  
  <p>that I want to look like this:</p>
  
  <p><strong>map/county</strong></p>
  
  <p>I wrote the following reroute in the routes.php file, which gives me the 404 error:</p>
  
  <pre><code>$route['search/map_view/(:any)'] = 'map/$1';
  </code></pre>
  
  <p>And just in case I was doing it backwards, I also tried it like this:</p>
  
  <pre><code>$route['map/(:any)'] = 'search/map_view/$1';
  </code></pre>
  
  <p>That didn't do anything, so I've deduced i did that incorrectly. A thing of note is that I do have apache's mod_rewrite changing my url's to drop the index.php from it. Don't know how that's helpful, but I've noticed it a lot in the other posts.</p>
  
  <p>Am I supposed to change something somewhere else for this? I'm assuming that if I type in the previous address, I should get automatically rerouted to the new one? Or if I type in the new address, it should work automatically? I don't know, it's getting really annoying...</p>
  
  <p>Anyhow, I have a lot of questions about this stuff, but I'm going to start  here and then see if I can find the rest of the answers here after I fix this one.</p>
  
  <p><strong><em>EDIT</em></strong> - I've been asked to include more info. Here it is.</p>
  
  <p>Here's the .htaccess content</p>
  
  <pre><code>RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L]
  </code></pre>
  
  <p>Currently I don't have any custom routes defined in the routes.php file, just because I can't get it to work correctly.</p>
  
  <p>The current controller is "Search", with the method "map_view" being passed a variable "county". So the url would be </p>
  
  <pre><code>http://www.base_url.com/search/map_view/county
  </code></pre>
  
  <p>I want to change this to </p>
  
  <pre><code>http://www.base_url.com/map/county
  </code></pre>
  
  <p>Everything else I've previously written still applies. Thanks again!</p>