You can try something like the following at the very top of your .htaccess
file in the document root (before the WordPress front-controller, ie. before the # BEGIN WordPress
block):
RewriteRule ^([\w-]+/)wp-admin /$1 [R,L]
This will redirect /<site>/wp-admin
to /<site>/
– where the site name can consist of any of the characters a-z
, A-Z
, 0-9
, _
and -
.
http://www.example.com/wp-admin
is accessible as normal.
Yes its working, if wordpress is in sub directory its not working.
If the WordPress .htaccess
file is in a subdirectory then you will need to modify the directive like so:
RewriteRule ^wp-admin /subdirectory/ [R,L]
However, your setup is still unclear. Do you have multiple .htaccess
files for different WordPress installs? A single multi-site .htaccess
in a subdirectory and no other .htaccess
files?