The MU forums have moved to

Forcing login on blog1 (6 posts)

  1. Bloggproffs
    Posted 16 years ago #

    is there any way to force users to login using the main site domain.tld instead of their own site nnn.domain.tld/wp-login.php like a sitewide login form ,where the users signs in using their "subdomain" name and their password. ive tried to use the search, but only getting alot of hits on customizing the deffault signin form.

    maybe im searching wrong?

  2. lunabyte
    Posted 16 years ago #

    You'd have to code it into wp-signup.php.

  3. dsader
    Posted 16 years ago #

    I might not try lunabyte's suggestion.

    general-template.php is the core file with the loginout function.

    here's the code from the core loginout (line 32-ish)

    if ( ! is_user_logged_in() )
    	$link = '<a href="' . get_option('siteurl') . '/wp-login.php">' . __('Login') . '</a>';
    	$link = '<a href="' . get_option('siteurl') . '/wp-login.php?action=logout">' . __('Logout') . '</a>';

    You want to replace the ' . get_option('siteurl') . ' with your main site domain.

    Do I need to caution you about editing core files? The notebook starts to get messy after a while.

    Might be easier with a rewrite rule in .htaccess.


  4. lunabyte
    Posted 16 years ago #

    What's wrong with a header redirect to the primary domain plus the original uri in wp-login?

    A lot easier to keep track of, really.

    Even easier than that, would be to put a check into your config file. Then it's not overwritten on updates and such. Just do a check for wp-login.php in the request uri, match up the server host, and do a header redirect to the main domain + the original uri.

    Either way, those are better than digging all the way into general template.

    I might not try dsaders suggestion.

  5. lunabyte
    Posted 16 years ago #

    Oh, duh. I originally said wp-signup. I meant login. Whatever.

  6. dsader
    Posted 16 years ago #

    Tee hee.

About this Topic

  • Started 16 years ago by Bloggproffs
  • Latest reply from dsader