Im using asp.net mvc c#. Based on user input I want to save the text they enter in the db and create a url using this text. there will be a unique id associated with this text too.
What should I factor when creating “clean” urls?
and also how should I avoid repetition – i.e every url should be unique,
so if 2 people type in: “Hey, Check My cool URL!!”
I’d probably want something like http://www.mysite.com/links/hey-check-my-cool-url/
How can i ensure they will always be unique and what should i do if the same description is entered twice?
Most people end up with some variation of loannis karadimas solution. However, two schemes that that I tend to use are:
This is because it indicates that the xxx digits aren’t part of the title of the link (depending on what you are doing).
Basically sticking the xxx digits at the end, because for SEO purposes (if you care) it is more likely that words closer to the root of your URL has higher predence for page rank. Of course take that with a grain of salt, like most other SEO tips!
PS, I don’t know much about ASP at all.