Skip to:

Opened 15 years ago

Closed 15 years ago

#511 closed defect (bug) (fixed)

Log In link not correct for WPMU with sub-directories

Reported by: terryjsmith's profile terryjsmith Owned by:
Milestone: Priority: major
Severity: Version:
Component: Keywords: login, URL, subdirectory


The redirect_to parameter on the Log In button is incorrect for WPMU installations with sub-directories. It generates URLs such as

File (bp-core/bp-core-adminbar.php), line 37:

echo '<li class="bp-login no-arrow"><a href="' . site_url() . '/wp-login.php?redirect_to=' . urlencode(get_bloginfo('siteurl') . $_SERVER['REQUEST_URI']) . '">' . __( 'Log In', 'buddypress' ) . '</a></li>';

Could be (for example):

$url = parse_url(get_option('siteurl'));
echo '<li class="bp-login no-arrow"><a href="' . get_bloginfo('siteurl') . '/wp-login.php?redirect_to=' . urlencode($url['scheme'] . '://' . $url['host'] . $_SERVER['REQUEST_URI']) . '">'  . __( 'Log In', 'buddypress' ) . '</a></li>';

Change History (2)

#1 @arghagain
15 years ago

My Buddypress installation is using subdirectory and is experiencing this too. Though I had no idea of how to resolve this, and so I copy the older Buddy Press version's snippet of code to redirect users to wp-login.php.

I would love to know how to fix this problem the right way! Help anyone?

For example, after they sign up, and login the first time, they need to be redirected to their profiles. Etc...

#2 @apeatling
15 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [1183]) Fixes #511

Note: See TracTickets for help on using tickets.