title: Mod_Rewrite with Query Strings In Pretty URLs
body: <p>I have an .htaccess file that redirects all URLs to the index.php file with a route query string parameter:</p>
  
  <pre><code># Enable Mod_rewrite
  RewriteEngine on
  
  # Redirect pretty URLs to the index file
  RewriteRule ^([\w\/\-]+)/?$ index.php?route=$1
  </code></pre>
  
  <p>This works great, with the exception of URLs with query strings in them. For example, I have a form that redirects back to the login screen with an error code (<code>/admin/login?error=1</code>). Obviously, the problem is, the <code>$_GET[error]</code> parameter is never passed to the main script.</p>
  
  <p>How would I get these parameters passed to the script?</p>