A mod_alias
newbie here.
I found the rewrite rule below somewhere and have been using it to block bots and hackers that hit my site, looking for directories like HNAP1
, wp
, blog
, etc.
And it works for that, returning a Forbidden 403
message.
<IfModule mod_alias.c>
RedirectMatch 403 /(\{\$itemURL\}|cro|HNAP1|wp|blog|)/?$
</IfModule>
But how do I also redirect /wp/wp-admin/
and /blog/wp-admin/
to a 403 message?
And any other subdirectory, i.e. /wp/wp-admin/subdirectory/
?
You should be able to add more patterns:
Hope this helps.