Our blog

 

mod_rewrite Strip Query String

To make your RewriteRule strip the query string, simply append a ? to the end of the rewrite path, eg:

CODE:
  1. # redirect all requests to a subfolder to the home page
  2. # strips query string
  3. RewriteEngine On
  4. RewriteBase /
  5. RewriteRule ^subfolder/.*$ /index.php? [L,R=301]

More Reading:

 

Leave a Reply