title: mod_rewrite so that first-level subdirectory is a GET variable
body: <p>Alright, title is REALLY sloppy.</p>
  
  <p>Here's my problem: I have a news site and when you go to the main page (<code>domain.com</code>) it redirects you to <code>domain.com/news/top?geography=San_Francisco</code> after it figures out your geography.</p>
  
  <p>How do I use the .htaccess so that it goes from <code>domain.com/news/top?geography=San_Francisco domain.com/San_Francisco/news/top</code>  ?</p>
  
  <p>There are some similar questions, but I have not found one similar enough in that you're editing the URL as a furtherback subdirectory.</p>
  
  <p>It should also be noted that I am using the Code Igniter framework for PHP and it normally has it as <code>domain.com/index.php/news/top?geography=San_Francisco</code> but I did a mod_rewrite already to get rid of the <code>index.php</code>.  The code is as follows for that:</p>
  
  <pre><code>RewriteEngine on
  RewriteCond $1 !^(index\.php|images|robots\.txt)
  RewriteRule ^(.*)$ /index.php/$1 [L]
  </code></pre>
  
  <p>Code I've tried:</p>
  
  <pre><code>RewriteRule ^([^/]+)/news/top$ /news/top?geography=$1 [L,QSA]
  RewriteCond $1 !^(index\.php|images|robots\.txt)
  RewriteRule ^(.*)$ /index.php/$1 [L]
  </code></pre>