Support » Networking WordPress » One login for all blogs in a multisite!

Viewing 15 replies - 1 through 15 (of 15 total)
  • This is a question about the syntax for Apache .htaccess redirect directives, so not really one for a WordPress forum.

    Given that you’re asking it here, can I ask why you want to do this? Your Multisite system uses a shared set of usernames and passwords, and users log on to the Multisite system, not an individual blog. Where do you want them to end up once they’ve logged in? If they don’t have any rights on the main site, this seems an odd thing to want to do.

    I don’t want to customize every login page for every blog, just the one in the main site 🙂

    There are plugins that will handle that for you. Search for “wordpress plugin custom login page”.

    I already have a custom login page is here:, I don’t need a plugin for that.

    I don’t want that login page to be replicated… I don’t want stupid duplicated content on all my child themes… I need one login page for all my sites/blogs… so when somebody try to login from any subdomain… like to be redirected on

    It that simple 🙂

    Moderator Ipstenu (Mika Epstein)


    Lead Plugin Wrangler

    Doesn’t really work that way. I mean, you could run a redirect to send everyone from NOT… to for logins, but that may cause issues with cookies.

    I do know that if you log in for one site, you’re logged in for all, but sometimes I have to re-login on subdomains, so I wonder if there are cookie issues going on.

    @ipstenu if you know how to make a redirect with .htaccess, please give me the script and I will try to see if I got any problem with cookies; as far as I know WordPress use same cookies on all the blogs/sites on a MultiSite installation.

    What do you mean: “redirect to send everyone from NOT… to”?
    I don’t want to redirect from another domain. I use one domain with WordPress Multisite (subdomains) … and on the main site ( I use BuddyPress. All members that login on main site… have access and are logged in on all of my blogs/sites/subdomains … no problem with that. I tested.

    I just want a simple redirect of all my login pages (of blogs/sites/subdomains) to one single login page (on main site)… the login page should look the same by using one custom login page that I can easily be customized when I need to… I really don’t see what is the problem with this… now members already login from that login page, but some members will try to login from subdomains, especially if they know the site is build on WP platform… and I don’t want them to see the “NOT SO CUSTOMIZED” login pages that themes offer by default 🙂 …

    Thanks you guys for taking the time with this 🙂

    What do you mean: “redirect to send everyone from NOT… to”?

    Ipstenu doesn’t mean redirect from another domain, I think, but redirect from a subsite to the main site.

    Moderator Ipstenu (Mika Epstein)


    Lead Plugin Wrangler

    Right, I mean something like using a

    RewriteEngine on
    RewriteCond %{HTTP_HOST}   !^$
    RewriteCond %{HTTP_HOST}   !^ [NC]
    RewriteRule ^/wp-login.php(.*)$1 [L,R=301]

    Which says ‘If you’re from *, then…’ NOT means just that. Anyone on the server that isn’t coming to wp-login.php ON, but instead comes to, goes to

    That said, I have no idea how well it’d work.

    The other option would be to look into how things like BuddyPress handle logins.

    @ipstenu, thank you, but it doesn’t work.
    I search on internet for this and is so strange that I’m like the only one that wants a unified login page for a Multisite/BuddyPress site.

    This is my default .htaccess file

    Moderator Ipstenu (Mika Epstein)


    Lead Plugin Wrangler

    Make a page on your main site and put a login form there. Use for the code (which you’ll put in your pagename.php file, not the source of the page).

    Then you just make that your login link.

    wp-login.php will still work (it has to, since other things rely on it), but you’ll direct people to that page to login. You could even edit the buddybar to link there for login.

    Just wanted to touch base and ask a question.

    I’ve used a rewrite rule for login redirects on WordPress installs but noticed in a Multisite with subdomains that each site has a wp-login.php and the rewrite doesn’t seem to work on main site let alone others.

    Better way to handle this?

    add_rewrite_rule( 'login/?$', 'wp-login.php', 'top' );

    Figured out my own answer!

    add_rewrite_rule( 'login/?$', 'index.php?login=true$matches[1]', 'top' );

    Then added a query variable login, and did a redirect on pre_get_posts

    @austin Passy
    I’m glad that my topic inspired you so much…:D maybe one day I’ll find my own answer just like you did 🙂

    I’m glad this thread is not closed since I’d like to do something similar.

    The blogs on my multisite are not personal blogs, but photo galleries and links in different content areas (like categories I guess, but bigger with separate URLs). What I want is for anyone who registers on any site to be automatically registered for all sites and get a profile made for them on the main buddypress site and bbpress forum.

    But I’m not sure how to do it. Does buddypress have a way to handle that and somehow “know” that someone registered on a sub site?

    Nio, did you find an answer to your single login page for all sites question?

    No, but somehow I resolved the “issue”.
    I redirected the login pages to they respective homepage.
    Like this: Redirected To Redirected To

    I only have a login form on my main/root site, but that’s OK for me.

    I’m still interested for a solution to my first statement for my feature projects.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘One login for all blogs in a multisite!’ is closed to new replies.