Some web addresses are produced via our script. I have to trim each one of these via htaccess I've got a couple of hundred of these, so that all ?xxx need to be washed.



or anything beginning with ?, the ? and also the relaxation isn't needed.

attempted RewriteRule ^?(.*)$ / [R=301,L] but didn't work :(

what must i use rather than ?(.*)

the road does not retain the querystring. Use RewriteCond to complement any none-empty querystring.

RewriteCond %{QUERY_STRING}  !^$
RewriteRule \.html$ $0 [R=301,L]

I additionally added a disorder that the url needs to finish in .html just just in case you need to then add php script later on.