Why do some URLs contain both a numeric identifier and a name?

I am wondering why the profile link looks like:

http://stackoverflow.com/users/ID/NAME 

not so easy:

 http://stackoverflow.com/users/ID 

or even better:

 http://stackoverflow.com/users/NAME 

Can there be pairs of users with the same name? Or does one user have many names?

+4
source share
7 answers

All SO URLs have an identifier / description of the form, where the identifier is unique and the description is optional. So /users/12890/arne-burmeister same as /users/12890/huhu and /questions/420380/why-does-the-link-to-the-user-profile-have-both-id-and-name is same as /questions/420380/foo . As a result of the search, the identifier is only used, but it is much better for google ranking when the user / question / what should ever be found in the URL (also for people it is much more descriptive ;-).

By the way, searching by ID is faster than such a large text string. And of course, the URL remains valid if someone changes their username or question.

+16
source

The part after the last slash seems to be related to SEO (i.e. makes the URL more expressive).
On the URLs I checked, you can replace this part with whatever you want, it still works. So url http://stackoverflow.com/users/37086/othername still points to your profile.

+4
source

I would suggest that finding a database exclusively on a name string would be more expensive than numerically searching for a primary key, even if the index column is indexed. A name is then added to make the URLs more user friendly and SEO friendly.

+2
source

There is a user request for this. If you want this to happen, uservoice is the right place to discuss / vote.

+2
source

Your name on SO is not unique, click on the user and enter Josh, there is a whole page. So you must have an ID. As for why the name that everyone else thinks is as good as mine.

+1
source

Try changing or deleting the name and see what happens.

I think it is so that your URLs tell you what to expect, but the application does not need (or actually use) this information.

Amazon does something completely similar to its books, if I remember correctly: they have both ASIN (their internal identifier) โ€‹โ€‹and the title of the book in the URL, but only ever look at ASIN.

0
source

Just speculate: ID allows you to very quickly retrieve the data presented on the profile page. The name is intended only for people and is ignored, since it is easier for me than you, rkj, and I am phihag than your ID 37086, and mine is 35070.

0
source

All Articles