title: Apache Redirect Loop
body: <p>I am getting a "webpage has a redirect loop" error on my rewrite rules in Apache. </p>
  
  <p>I want to have clean URLs for GET requests so if a user types www.flavor.com/vanilla that the server runs www.flavor.com/?s=vanilla but the url reads just www.flavor.com/vanilla so I added this:</p>
  
  <pre><code>RewriteRule ^([a-z]+)$ /?s=$1
  </code></pre>
  
  <p>This works fine, but I also want to have www.flavor.com/?s=vanilla to redirect to www.flavor.com/vanilla so I added this which is causing a loop.</p>
  
  <pre><code>RewriteCond %{QUERY_STRING} ^s=([a-z]+)$
  #RewriteRule ^(.*)$ /%1? [L,R=301]
  </code></pre>
  
  <p>I tried adding [END] and [L] to the both, but no help.  I've rewritten this 200 times and can't figure it out.</p>