4

Currently, the URL to a user's page is this:

website.com/user/bob

But I'm considering changing this to be:

website.com/bob

Without the /user/ part. It comes across as much cleaner and easier to access, as user pages are one of the most frequently-visited pages on my site.

I have, however, a few questions:

  1. Is this something I should do? Is it SEO friendly?
  2. Would this be done within my code (my routes file) or would it be done through .htaccess or some other method?

Thanks.

8

Do the /user/bob style, as there's a very good reason why you should not use /bob.

Specifically, that means you can't have any other paths in your website, as they might collide with a user name. For example, someone could name themselves "images" and now your /images folder doesn't work. Or someone who's name is "John Smith" but wants to be user "js" now is colliding with your /js folder where you put JavaScript.

Yes certainly with routing configurations you could allow this, so that /images/foo.jpg works and gives you the image "foo.jpg" in the image directory, but then /images would get you the user named images. That would basically be really confusing from the technical design perspective.

I know this isn't going to happen often, but in general it's just bad path design to have a scheme that you know can fail in some cases.

If you don't like the unfriendly naming of /user, try something else like /home or anything else you can think of that might be a bit less utilitarian.

5

Psychology in UX plays a huge role in order to understand users behavior and sentiments.

Placing user/member before the name affect users sentiments. Imagine users being the contributors to a website such as Facebook, Quora, Twitter etc... the users on these portals are not just users; they are contributors too.

So, giving it a personalized feel will boost users affection towards that website. I like the way Facebook personalizes URLs

https://www.facebook.com/dipak.suryavanshi

  • 2
    completely agree with this – Devin Sep 15 '17 at 19:48
4

The user/ part in the url acts as a namespace identifier, by separating user profiles from other accessible resources or entities. Say your app also has groups. Then an user Ana can be distinguished from a group Ana by the namespace identifiers e.g /user/ana and /group/ana.

If the word user needs to avoided for what ever reason, you can consider alternatives like profile/, gamer/, member/ etc.

Regarding SEO, keeping user/ in the url is beneficial since it adds one more keyword as well as increases the chance of having the url properly categorized by search engines.

  • 1
    While @Raiyan 's answer covers the two points you presented, also consider this: How likely is your user to access a profile directly through it's URL? I don't know the context of your application, but most regular users prefer to navigate a simpler, friendlier interface to get to the page they desire, even if it takes more steps, mainly because it doesn't require them to memorize "complex" identifiers and paths. Also, have in mind that several mobile devices hide the address bar when scrolling down. – Scribe Assistant Sep 15 '17 at 2:15
  • @ScribeAssistant, FB, Twitter, Instagram and G+ use this (just to name a few) and if you see ads, even leaflets, you will usually see {icon for service}+{username}. So I'd say it's extremely likely. – Devin Sep 15 '17 at 19:51
3

This sounds like a personal opinion type question, however, it does have a few potential design/development flaws.

I can't see as this would benefit SEO in any way - in fact, it could make it harder to associate this URL as a "user profile" since there is no parent path segment (subjective)? But it's difficult to imagine that a user profile page would be so important (SEO wise) for your site anyway?

Without knowing anything more about your site I would leave your URLs as /user/bob instead of simply /bob. Reducing the URL to simply /<username> could potentially create development issues (depending on how your site is implemented):

  • This could make the URLs harder to route (depends on how you are currently doing this). See note below.
  • What if a user called their username about, contact or login? Apart from being confusing for users, you would need to implement some kind of lengthy list of disallowed usernames in order to prevent these type of name clashes (prone to error). And this will naturally reduce the namespace of possible usernames. With /user/<username> everything is a username. Something like /user/about might still look confusing, but it won't break your site.

Would this be done within my code (my routes file) or would it be done through .htaccess or some other method?

Well, that depends on how your site is implemented. Certainly, if you change the URL from /user/<username> to /<username> then this is not something you could do in .htaccess. Since, in .htaccess there is no way to determine whether /<something> maps to a user profile or some other site page, like /about, /contact or /login etc.

  • 1
    This answer is so useful, I retracted my close vote to keep it alive. It makes perfect sense especially from a design and coding aspect. Simple and logical. – closetnoc Sep 15 '17 at 5:35
0
  1. Is this something I should do? Is it SEO friendly?

It should be fine either way.

  1. Would this be done within my code (my routes file) or would it be done through .htaccess or some other method?

Both. Code routing is better for user experience (loading times etc.). Server routing is better for SEO as static pages are the most search indexable kind of pages.

0

With the approach of website.com/bob you need to make sure that the user cannot select a username which is the name of a subpage (e.g. prevent a user from choosing the name "home" if there is a site website.com/home etc.) This becomes especially important if you want to keep the option of adding new pages later.

As DPS pointed out, facebook has a nice way that doesn't include a prefix by appending first and last name with a . in between which avoids all collisions as long as you choose your pages' names without dots respectively.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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