WordPress.org

Ready to get started?Download WordPress

Forums

Get lost password link to go to sub-site, not root. (1 post)

  1. moose123
    Member
    Posted 1 year ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.