• I know there was a recent thread about this here:
    https://www.ads-software.com/support/topic/log-in-link-on-wp-activatephp-links-to-main-site?replies=3

    but since that was market resolved I am opening a new item.

    In that thread the following code was provided as a possible fix to the login and homepage links on the activate page going to the main site rather than to the specific subdomain login or homepage:

    add_filter('network_site_url', function($url, $path, $scheme){
    
        if($path === 'wp-login.php?action=lostpassword'){
            $url = site_url($path, $scheme);
        }
    
        return $url;
    },10,3);

    However, I am not certain how to modify that code -the path for the issue I’m having is “wp-activate.php?key=” where an actual key is then concatenated at the end.

    I’m not that familiar with php but I tried using that string with an asterisk wildcard at the end: “wp-activate.php?key=*” to see if I would be directed to the subdomain pages but I am not.

    Is there something else I should modify to accomplish this?

    https://www.ads-software.com/plugins/join-my-multisite/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    You didn’t need to comment on that post ?? I get emails for every new post that’s tagged properly.

    But you don’t need to filter wp-activate. The issue in the previous thread is that the links for wp-login ON wp-activate.php is pointing to the main domain and not the specific site.

    Why do you think you need to redirect wp-activate? Where is that link being generated from? I need a little more information before I can tell you the right answer.

    Thread Starter vduv

    (@vduv)

    I believe I am having that same issue:

    I am using the [join-my-multisite] shortcode to produce a registration form on a page I’ve created
    When a user registers they get an email that says “to activate your user please click the following link” and it gives a link formatted as follows:
    https://subdomain.site.com/wp-activate.php?key=alphanumericvalue
    It also says “After you activate, you will receive “another email” with your login. (note a second email is not sent)

    When the user follows that link they land on a page that says
    “Your account is now active!” and gives their user name and password. Then it says” Your account in now activate. Log in or go back to the homepage” With links on “Log In” and “homepage”

    These links go to the site.com login and homepage. I want them to go to the subdomain.site.com login and homepage.

    I have 26 subdomain sites for this organization and I’m trying to keep users on their own site. The subdomain sites are not totally live yet but you can see this action at
    fairmont.lgfws.com/fairmont-lgf-user-registration/

    Thanks for taking a look at this.

    Val

    Plugin Author Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    When the user follows that link they land on a page that says
    “Your account is now active!” and gives their user name and password.

    Are you running other plugins?

    The email is actually NOT something I messed with.

    Thread Starter vduv

    (@vduv)

    I’m really not concerned with the email.

    I am trying to figure out if there is a way to make the login and homepage link on the page at https://subdomain.site.com/wp-activate.php?key=alphanumericvalue go to the subdomain login and homepage rather than the mainsite.

    Since its not a lost password issue I used your code and just left it at path=wp-login.php (without any further “action=” variable) That worked for the Log In link.

    But since the homepage link on that page goes directly to the main site with no other path – it doesn’t seem there would be a similar code snippet to address that link and send it to the subdomain.

    If there is anything else you can suggest please let me know.

    I have several other plugins running – but don’t believe any of them would be changing the url of a login or homepage link. They include Appointments+, and Admin Menu Editor Pro

    Plugin Author Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Since the email is not the standard WP email, it matters.

    I can’t tell you how to filter something if I don’t know what’s making it, you see. I know, sometimes, when dev’s ask you weird questions that they can seem nonsensical. But without that information, we can only give you vague answers.

    When I can’t reproduce what you get, I have to ask the weird questions. So … Yeah, it matters.

    printf( __('Your account has been activated. You may now <a href="%1$s">log in</a> to the site using your chosen username of “%2$s”. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%4$s">reset your password</a>.'), network_site_url( 'wp-login.php', 'login' ), $signup->user_login, $signup->user_email, wp_lostpassword_url() );

    That’s the line of code the filter is impacting. We’re addressing network_site_url and changing it.

    If your site isn’t sending THAT email, and you can look at wp-activate.php to see what yours says, then the issue is likely to be what ever is overriding the email, because it’s also likely to be messing with that page output.

    Please list me all your other plugins and your theme. If it’s a homemade theme, you’ll have to try testing this on the default theme since I can’t access custom themes. Otherwise, I will try to reproduce this as best I can and walk back through it to see where it’s confused.

    Thread Starter vduv

    (@vduv)

    Plugins:
    Network Activated:
    Admin Menu Editor Pro
    Appointments+
    Join my multisite
    Weather Underground
    WordPress Importer
    WordPress MU Domain Mapping
    WP Cloudy
    WPMU DEV Dashboard

    NotActivated
    Akismet
    Booking System Pro

    The Theme is Enfold by Kriesl on Themeforest

    So since I’m using a non-wp theme, I assume you need me to try this on a default theme? I will have to get that setup and see what happens. I will post back when that is done.

    Plugin Author Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Keep in mind, what plugins you’re running on the main site of your network ALSO impacts what happens on the network admin. WP has to load things in weird ways.

    Can you confirm the exact wording of the page that lists the username and password? It’ll be easier for me to grep for that (WPMU DEV Dashboard is the only plugin I think I can’t get access to…)

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Issue with redirect on log in page’ is closed to new replies.