Easiest way?
Redirect 301 /login /wp-admin/
Should work.
what would you do if you get 500 internal server error after having this code in .httaccess?.
Because that is what happening.
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
Redirect 301 /login /wp-admin/
Always put the rules on top π
Redirect 301 /login /wp-admin/
#Begin WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
#End WordPress
Though looking into it, I think that redirecting to wp-admin is protected somehow. I can make it work, but it forces a login loop. This works:
RewriteRule ^login/$ /wp-login.php [L]
Hello lpstenu,
You are the best!!!
Its working but I am having a problem that. sometimes it give me 400 error. In random times. very rarely though… can you tell me how I fix it?.
Do I put this in or replace it with another rule?
RewriteRule ^login/$ /wp-login.php [L]
Replace Redirect 301 /login /wp-admin/ with RewriteRule ^login/$ /wp-login.php [L]
See if that works better.
Dear Support,
I am having a similiar need for login redirects, but after attempting the solution cited, I’m not getting the results I was hoping for. Let me explain the situation:
WordPress Multisite (yes)
2 sites
First site is standard site
Second site is Buddypress
Using folders; not subdomains
Goal:
If a user navigates or clicks a link that would normally take them to the login screen for the Buddypress site installation, auto redirect to the login screen for the first site (main). Always use first site’s login screen for all logins…
Thanks for looking at this.
s
Digital-Ninja – Make your own topic please π
This problem has been fixed. Thanks for all your support Ipstenu!!!