BuddyDev

Search

Redirect to User Profile

  • Participant
    Level: Initiated
    Posts: 10
    Rik on #50817

    Hi,

    Is there a way to (re)direct the user to his user profile on either login or when he/she opens the members directory?

    Best

    Rik

  • Participant
    Level: Initiated
    Posts: 10
    Rik on #50818

    Just to clarify further…

    I can directly go to “my” profile from anywhere on my website by using the following URL:

    https://wattlesfarm.com/member-portal/members/hendrik/profile/

    Is it possible to change my username “hendrik” to the generic field “username” so that all users are automatically directed to their specific profile when using the following link:

    https://wattlesfarm.com/member-portal/members/username/profile/

    I hope this makes sense…

    Best

    Rik

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #50820

    Hello Rik,

    Thank you for posting. Have you looked at the following plugins:

    For login redirect
    https://buddydev.com/plugins/bp-redirect-to-profile/

    For changing username:
    https://buddydev.com/plugins/bp-username-changer/

    Please take a look and let me know if it helps or not.

    Regards
    Ravi

  • Participant
    Level: Enlightened
    Posts: 28
    Michael on #50821

    Hi Rik

    You could change “/username/” to “/me/” in your link, this should then dynamically point at the logged-in user’s individual profile.

    For example:

    /members/me/profile

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #50823

    Hi Rik,
    As @michaelm has suggested, BuddyPress has a special meaning for slug ‘me’ if used with directory url. If a user is logged in, It points to them.

    Example:- your site has a directory at http://example.com/members/

    Then the http://example.com/members/me/ will point to the logged user home page and http://example.com/members/me/profile to their profile.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 10
    Rik on #50824

    Thank you both!

    I changed the link to /members/me/profile/

    When I’m logged-in it does indeed bring me to my profile.

    However, when I login as a different user, the me-link still brings up the hendrik-profile instead of the new user’s profile!

    Looks like “me” is still associated with “hendrik” and not the logged-in user’s individual profile.

    Any suggestions why and how to solve that?

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #50836

    Please use the complete url with http://yoursite.com/members/me/profile.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 10
    Rik on #50838

    Hi Brajesh,

    I did use the comlete url:

    https://staging23.wattlesfarm.com/members/me/profile/

    This brings up my admin profile (username: hendrik):

    https://staging23.wattlesfarm.com/members/hendrik/profile/

    However, if I login as another user using the */me/profile/ link it will still bring up my admin profile and not the profile of the user I’m logging in as. So the hendrik-profile seems to be persistent.

    Any thoughts/suggestions?

    Best

    Rik

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #50839

    Hi Rik,
    That would be very strange. I assume there is something causing it on your setup as this is not the expected behaviour.

    I will suggest disabling custom code/plugins and recheck.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved