Its my understanding that the questions in StackOverflow has the following format
http://stackoverflow.com/questions/{question-id}/{slug-made-from-question-title}
So basically the question is retrieved using the question-id. so whatever value I give the slug is immaterial.
First I would like to know whether this understanding is wrong 🙂
I have a URL
http://stackoverflow.com/questions/6291678/convert-input-string-to-a-clean-readable-and-browser-acceptable-route-data
Then I changed the slug manually like this.
http://stackoverflow.com/questions/6291678/naveen
But it changed to the original slug. Firebug showed me a permenant redirect 301 on the altered URL. How to implement this functionality?
You can do this with
Response.RedirectPermanentavailable since ASP.NET 4.0:http://msdn.microsoft.com/en-us/library/system.web.httpresponse.redirectpermanent.aspx
On an unrelated side note, would like to think Stack Overflow is not saving the slug at database. Its created dynamically from title using something like this. I just altered the title of my question and the slug changed. It will be un-necessary to store the slug in database as it is redundant to title.