用户名作为路径

问题描述:

我想将用户名称作为URL的一部分,例如mysite.com/username。这应该重定向到用户配置文件。我使用个人资料2 Pathauto ,但我不知道该怎么做。

I would like to have a user's name as a part of a URL, e.g. mysite.com/username. This should redirect to the user profile. I use Profile 2 and Pathauto, but I am not sure how to do this.

使用pathauto,您只需使用用户令牌配置用户路径,例如 [user:name]

With pathauto, you just have to configure user paths with a user token, e.g. [user:name].