title: Apache redirect to main URL on Query
body: <p>i have requirement to redirect Apache on query base parameters for example </p>
  
  <p><a href="https://example.com/?ampostpreserve=01902018" rel="nofollow noreferrer">https://example.com/?ampostpreserve=01902018</a></p>
  
  <p>I need to redirect to <a href="https://example.com" rel="nofollow noreferrer">https://example.com</a> .. I tried with </p>
  
  <blockquote>
    <p>RewriteEngine On RewriteCond %{QUERY_STRING} ^ampostpreserv$
    RewriteRule (.*) <a href="https://example.com" rel="nofollow noreferrer">https://example.com</a> [R=301,L]</p>
  </blockquote>
  
  <p>but seem not working ..any solution</p>
  
  <p>Thanks Hem </p>