Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do some URLs contain both numeric id and name?

Tags:

url

seo

I am wondering why the link to profile looks like:

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

not simply:

http://stackoverflow.com/users/ID

or even better:

http://stackoverflow.com/users/NAME

Can there be couple users with the same name? Or can one user have many names?

like image 380
rkj Avatar asked Nov 28 '22 05:11

rkj


1 Answers

All SO-URLs are of the form id/description where the ID is unique and the description is optional. So /users/12890/arne-burmeister is the same as /users/12890/huhu and /questions/420380/why-does-the-link-to-the-user-profile-have-both-id-and-name is the same as /questions/420380/foo. The retrieval just uses the ID, but it is much better for google ranking, when the user/question/what-ever-should-be-found occurs in the URL (also for humans this is much more descriptive ;-).

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

like image 125
Arne Burmeister Avatar answered Dec 06 '22 03:12

Arne Burmeister