title: .htaccess rewrite GET variables w/ 301 redirect
body: <p>I'm trying to simultaneously do a 301 redirect and imporve my url structure by stripping the get variables.</p>
  
  <p>I recently updated my website and Google has some old pages cached that have since moved. The structure looks like this</p>
  
  <pre><code>wwww.domain.com/locations.asp?zip=10001 &lt;---OLD URL
  wwww.domain.com/locations/?zip=10001 &lt;---NEW URL
  </code></pre>
  
  <p>Right now I'm redirecting the old page to the new using the following line in my .htaccess file:</p>
  
  <pre><code>Redirect 301 /solar_panel_systems_zip.asp /zip-code/
  </code></pre>
  
  <p>The above works fine but I'd like the URL to be as follows:</p>
  
  <pre><code>wwww.domain.com/locations/zip/10001
  </code></pre>
  
  <p>I came across this post <a href="https://stackoverflow.com/questions/7677070/htaccess-rewrite-get-variables">.htaccess rewrite GET variables</a> and tried this rule but no luck :/</p>
  
  <pre><code>RewriteRule ^([\w\d~%.:_\-]+)$ index.php?page=$1 [NC]
  </code></pre>
  
  <p>I'm assuming this is because I'm 301 redirecting and doing a rewrite?</p>