Lost password on multi site redirecting to main/root site and not subsite

Ok so the "Lost your password? " option on the "my-account" page is redirecting to the main/root site and not the subsite.
I found this question previously asked here: https://premium.wpmudev.org/forums/topic/why-does-the-sub-site-forgot-password-button-redirect-the-user-to-main-site
I followed that guide on my site and added the code found on: https://gist.github.com/eteubert/293e07a49f56f300ddbb in the following ways to my site: 1: added to child functions.php(removed top <?php tag),2: i added the plugin as a "mu-plugin",3: Idownload the zip directly from the site and uploaded it as a plugin(which is currently still active), 4:i also added the code as a snippet via the plugin "snippets" but none of those did the trick for me.
Can it be that the solution is not currently working in 2018 or could I possibly be doing something wrong or is there maybe another solution to this error?
FYI i am using wordpress Version 4.9.8 and woocommerce Version 3.4.2( i know woocommerce also changes the my-account page)

  • Adam Czajczyk

    Hello Steve

    I hope you're well today!

    The registration and lost password forms are always on the main site of multisite by default. It's an expected behavior that the lost password link will redirect user to the main site.

    The code from the gist that you shared in your post seems to be working fine, though. I've created an empty file with a .php extension, copied the entire code there, uploaded it to "/wp-content/plugins" folder of my multisite and then netowork activated ("Network Admin -> Plugins").

    I then checked some sub-sites of my Multisite and the "Lost password" link kept me within these sub-sites. It also doesn't seem to interfere with a default WooCommerce install (I tried with network-activated WooCommerce).

    Knowing that, I'd say that there's something else interfering there: it's either some code from a theme or from some other plugin or even some specific settings.

    What you could do, would be to try to identify that:

    1. make sure that the code is added just like I described it above (and all the other possible occurrences of it that you tried are already removed from site)

    2. select one sub-sit to test and change its theme to Twenty Seventeen and then check if it works; if not, then enable theme back and go to step 3

    3. disable all the plugins on site (except for that one that you're testing) and check again; if it works then try enabling plugins back one-by-one, each time checking if it's working, until it stops - then you know which plugin is interfering and we could further diagnose it.

    Give it a try please and let me know about the outcome.

    Best regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.