Support » Networking WordPress » Login Redirection Page For All Multisite

  • Resolved strang3r

    (@strang3r)


    I would like to know what do I have to edit in my .httaccess for having this below result…

    When a person visit example.com/login or site1.example.com/login (no page exists with login name) in my multisite, I want them to be redirect into example.com/wp-admin or site1.example.com/wp-admin and I want this to happen all new websites get created and for the old sites which already been made.

    Any help please?.

Viewing 10 replies - 1 through 10 (of 10 total)
  • 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!!!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Login Redirection Page For All Multisite’ is closed to new replies.