I have pages that are called via a query strung from a cgi.
xyz.cgi?page=abc.html
The problem that I have is that I get bot requests for pages
You can use the following rule to remove chars after the html extension :
RewriteRule ^(.+\.html).+$ /$1 [L,R]
This will redirect
/foo.htmlchars
to
/foo.html
Or
RedirectMatch ^/(.+\.html).+$ /$1
EDIT :
To redirect /xyz.cgi?page=foo.htmlchars to /xyz.cgi?page=foo.html you may using the following :
RewriteEngine on
RewriteCond %{THE_REQUEST} /xyz\.cgi\?page=(.+\.html).+\sHTTP [NC]
RewriteRule ^ /xyz.cgi?page=%1 [L,R]