I currently use a mixture of Freemember & User to create my customised profile/account pages.

The urls for these types of pages are things like member/profile/{member_id}/favourites or member/profile/{member_id}/bookmarks

Where segment 3 is always the member ID.

I was wondering if its possible to change segment 3 to use the members username rather than the member ID?

It will make for nicer more personalised urls, but I'm not sure if there's a downside or if it even would work?

  • Have you checked the User and Freemember docs to see whether a username parameter is available for the tags that you're using? It looks like username is a valid freemember parameter.
    – Dom Stubbs
    Feb 26, 2013 at 15:38
  • Hmm, just had a check and it appears that username is a valid parameter in Solspace's Favourites module as well (I need this to work). So its looking like its possible. Just wanted to make sure there wasn't any obvious downsides to using the username in the URL.
    – shorn
    Feb 26, 2013 at 16:32
  • I suppose you might run into issues if people are using non-alphanumeric characters, I'm not sure how strict EE is about the chars used in usernames. If it is fairly relaxed then you might need to look into URL encoding to avoid issues.
    – Dom Stubbs
    Feb 26, 2013 at 16:57

1 Answer 1


Yes, you can use the username in the URL and display member profile data based on this username. See User's documentation on the username="" parameter in {exp:user:stats} for more details. From the documentation:


This parameter allows you to show the specified members' stats. A variable like {segment_3} can also be used to pull a username from the URL.

The only caveat is when the username contains characters that EE or your server does not allow. Check your EE/Server settings if you encounter disallowed character-type errors.

Alternatively, you could make your registration/profile edit forms in a way that prevents the user of anything but alphanumerical characters, for example. A javascript/jQuery validation script could be used for that purpose.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.