title: HIDE variables from google using mod rewrite
body: <p>I noticed that google indexes my pages with the variables in the URL and others pages without them. These other pages do not have variables in them and are indexed fine without the php extension.
  <br><br></p>
  
  <p>For example:  </p>
  
  <p><strong>mydomain.com/page.php?name=flinstones</strong></p>
  
  <p>my htaccess rewrites that to:</p>
  
  <p><strong>mydomain.com/flinstones</strong>
  <br><br></p>
  
  <p>But it still shows as the former in google search and google analytics.</p>
  
  <p>Is there a way to force it to show/browse only the pretty urls?</p>
  
  <p>Here's my code.. first part works but the redirect doesn't. 
  <strong>How do I make it work?</strong></p>
  
  <pre><code>RewriteEngine On
  RewriteRule ^([^/\.]+)/?$ page.php?name=$1 [L]
  
  RewriteRule ^page.php?name=([^/\.]+)/?$ /$1  [R=301,L] 
  </code></pre>
  
  <p>Thanks,</p>