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:
/2014/how-to-manage-wordpress-multisite-imports-with-wp-cli/#comments
The #
is not URL encoded.
I tried both following methods:
RedirectMatch 301 \#comments /
and
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?
#
on.