WordPress.org

Support

Support » Multisite » Get lost password link to go to sub-site, not root.

Get lost password link to go to sub-site, not root.

  • Hello,

    Running multi-site 3.5.1. It’s running behind a proxy, which allows all sub-sites (https://www.mysite.com/site_1) but denies access to the root site’s admin pages, such as:

    https://www.mysite.com/wp-login.php?action=lostpassword.

    But when someone wants to recover their password for their sub-site from their site’s login page, their “Lost your password?” link always takes them out of their sub-site and sends them to the root version:

    https://www.mysite.com/wp-login.php?action=lostpassword

    …instead of:

    https://www.mysite.com/site_1/wp-login.php?action=lostpassword

    So, how can I get each sub-sites “Lost your password?” link to retain the URL structure of their site and send them to their own “wp-login.php?action=lostpassword” page?

    I’ve tried passing a few arguments to wp_lostpassword_url() but with no luck yet. The actual hyperlink PHP code for this is:

    <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>" title="<?php esc_attr_e( 'Password Lost and Found' ) ?>"><?php _e( 'Lost your password?' ); ?></a>

    Unless I’m not looking at the right function.

    I appreciate any help on this.

    Thank you!

  • The topic ‘Get lost password link to go to sub-site, not root.’ is closed to new replies.
Skip to toolbar