Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Rewriting up one level

Sambauers,

As you suggested, I was able to modify get_user_profile_link() function in template-functions.php to prevent the redirection. Mod_rewrite will now rewrite to the profile page properly, without redirecting it.

But now, it shows I’m no longer logged in when I’m on a rewritten page, even though I am. When I try to log in. It just reloads the page.

Here’s the mod in_user_profile_link():

function get_user_profile_link( $id = 0, $page = 1 ) {
$user = bb_get_user( bb_get_user_id( $id ) );
$rewrite = bb_get_option( 'mod_rewrite' );
if ( $rewrite ) {
if ( $rewrite === 'slugs' ) {
$column = 'user_nicename';
} else {
$column = 'ID';
}
$r = bb_get_option('uri') . "profile/" . $user->$column . ( 1 < $page ? "/page/$page" : '' );
} else {
$r = bb_get_option('uri') . "profile/" . $user->$column . ( 1 < $page ? "/page/$page" : '' );

}
$r = str_replace('forums/profile/' . $user->$column , "profile/" . $user->$column, $r);
return apply_filters( 'get_user_profile_link', $r, $user->ID );

}

My goal is create a short URL such as http://www.example.com/profile/username

Skip to toolbar