Forum Moderators: phranque
# replace string
RewriteCond %{QUERY_STRING} cat=([^&]*)
RewriteRule ^(.*)$ http://www.domain.com/index.html?rat=0&cat2=%1 [NC] RewriteRule ^(.*)$ http://www.domain.com/index.html?rat=0&cat=%1 [NC] If that query string only appears with certain file names, then change the (.*) pattern to match that filename. At present, the above code looks for a query string on every request for every page, every image, every CSS file, etc.
The above code generates a 302 redirect. Specify R=301 if you need a 301 redirect.
Add the L flag to every rule unless you know exactly why you are omitting it.