On one of my sites I get 404s because some scripts are fetching all URLs from the start page as raw URLs, so they include the
# in the URL. Normal browsers don’t ever send that part to the server, but these scripts do.
This is how a typical requests URL looks like:
# is not URL encoded.
I tried both following methods:
RedirectMatch 301 \#comments /
RewriteRule #(.+)$ /? [L,R=301]
Both without success, the rules don’t catch these requests, because the
# starts a comment. The referer and the user-agent fields are empty.
What should I do?