Remove query strings from URL's with mod_rewrite

If you need to strip query strings from a URL with mod_rewrite, you can use a rewrite syntax such as the following:

RewriteEngine on
RewriteCond %{QUERY_STRING} "action=register" [NC]
RewriteRule ^/. http://www.domain.com/registerpage.html? [R,L]

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Printed from: http://rackerhacker.com/2007/05/18/remove-query-strings-from-urls-with-mod_rewrite/ .
© Major Hayden 2010.

Leave a Reply