Forum Moderators: phranque
example.com/filename.php?do=something /filename.php (with no query string). All the query-string URLs were robots-excluded (they were basically login pages for a CMS linked from each page). RewriteCond %{QUERY_STRING} .
RewriteRule ^.* - [G,L]
RewriteCond %{QUERY_STRING} .
RewriteRule ^ - [G]
RewriteCond %{QUERY_STRING} .
RewriteRule ^(.*)$ http://www.example.com/$1? [R=301,L]
# Force a 404-Not Found response to any URL with any query string appended
RewriteCond %{QUERY_STRING} .
RewriteRule ^ /some-filepath-that-will-never-exist.lmth [L]
# Force a 404-Not Found response to any URL with any query string appended
RewriteCond %{QUERY_STRING} .
RewriteRule ^ - [R=404,L]