What is the difference between…
http://mysite.com/12345
and
http://mysite.com/an6
I am wondering because it would be easier to handle everything as numbers and I still see no reason to move from numbers to alpha numeric.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Essentially in the two examples you gave there is not much difference. Other than the fact that you could include more non-informative characters. There is no (human readable) information contained within the URL’s… They might hold :
The difference comes into play when you start to embed some useful information in those URLs… Take for example the URL’s on this site – specifically yours and its address –
https://stackoverflow.com/questions/9749505/numeric-vs-alphanumeric-urlSo what can we see from here (other than that its a Stack Overflow link and obviously the right source for getting your progrmaming questions answered 😉
stackoverflow.com/questions/stackoverflow.com/questions/9749505questions/9749505/numeric-vs-alphanumeric-urlTo get these “friendly URLs” one could possibly use a
.htaccessfile redirecting requests between URL’s.Here is a simple example of what an
.htaccessfile could accomplish :Whats happening here is this – the actual URL that the user and browser sees is :
example.com/questions/12345But the actual script that process the request is
getQuestion.phpand it gets passed a variable that was extracted from the original URL (specifically the number). Then that script will retrieve the content and display it but the URL remains the same URL with the/questions/12345.In actual fact the
getQuestion.phpfile will handle all requests to questions.So you see, there is no real difference between alphanumeric and numeric URLs – the difference is when you start embedding useful info into them making simply reading their names more informative for the user (and for you as the developer).