Forum Moderators: phranque
# If non-blank query string
RewriteCond %{QUERY_STRING} . [NC]
# on static filetype, then rewrite to nonexistent path to force a 404
RewriteRule \.s?html?$ /path_to_file_that_does_not_exist [NC,L]
# If non-blank query string
RewriteCond %{QUERY_STRING} . [NC]
# on static filetype, then force a 410 response
RewriteRule \.s?html?$ - [NC,G]
# If non-blank query string
RewriteCond %{QUERY_STRING} . [NC]
# on static filetype, then redirect to the same URL after stripping off the query string
RewriteRule ^([^.]+\.s?html?)$ http://www.example.com/$1? [NC,R=301,L]
Also, if you use filepaths with periods in them other than the final one before the filetype, then change the pattern in the last rule to the much-less-efficient but less-selective "^(.+\.s?html?)$"
See also this recent thread: [webmasterworld.com...]
Jim