I am trying to set up username as a main path to the user profiles in Drupal 7; for example, I would like to have mypage.com/someusername as path alias for the profile of the user that uses "someusername" as username.

I am using the Profile 2 module as well. I tried everything, but I cannot achieve this.


If you use the Pathauto module, you can set an automatic alias for the user profiles using a token that is replaced with the username. In Pathauto for Drupal 7, the default pattern for user paths is /users/[user:name], which is the pattern I would suggest to use to avoid conflict with path defined from other module. As you don't control the username chosen from a user, it could happen the username is admin, which conflict with the path used from system.module for its own menu callback.

If you want to use a different token, the list of available tokens is available right after the text field used for the pattern to use.


What I reported is still valid for Drupal 6; the difference is that the token for the username is [user].


There is the Menu token module for defining paths like 'user/[user:uid]'.


Tokens are provided by Token module. Menu Token allows to use both global tokens and entity one: node, user, term. Entity tokens have several methods of substitution: from context, random and user defined.

  • In this case, it doesn't help, as the profile path is already defined from a module. – kiamlaluno Aug 1 '12 at 14:24

Just came across this issue and in case anyone reading this didn't get much enlightenment, I'll light up a bit more.

By default, drupal use "user/{user_id}" for the path to your Profile page. And on your path page above it could written "users/[user:name]" to go to some page like www.example.com/not-my-real-name-but-username-use-for-login

So to link to your Profile page,

  1. aside from setting the Path like kiamlaluno described above...

  2. remember to Delete all your user aliases on "Delete aliases" tab and rebuild them using the new pattern you entered above from "Bulk update" tab.

Hope that helps. Saved me few hours.

Your Answer

