This question came from our site for professional and enthusiast programmers.

3

@paxdiablo that is not a meta question - it is a programming question
–
Marc Gravell♦Sep 1 '11 at 8:30

@Marc, not sure how this is any different to any of the other "how does SO work?" variants that were nudged across. But, it appears you have used that blue diamond to back out the vote. So much for a community-driven site :-)
–
paxdiabloSep 1 '11 at 8:34

2

@paxdiablo the question isn't really relating to the SE engine - it relates to a programming technique with SE simply as the example. If other questions have been migrated similarly, they are also incorrectly migrated. This is not on-topic for that site.
–
Marc Gravell♦Sep 1 '11 at 8:37

1

@Marc, that FAQ explicitly states: Stack Overflow, Area 51 or the SE engine". I would put this under the first of those. If the question were a more general one related to how to do something similar to the way SO does it, then I would have let it go. But it asked explicitly about the methods in SO, which I contended it was clearly a meta question. I don't want to start an argument so I'll shut up now. Just explaining my reasoning.
–
paxdiabloSep 1 '11 at 8:43

3

Given the "I want to know because I am also creating this type of website for my college project", one could interpret SO being mentioned for the sake of example.
–
CodeCasterSep 1 '11 at 8:48

paxdiablo, You are wrong, this is a SO question.
–
LaykesSep 1 '11 at 8:52

Route-based (rather than page-based) handling is a core component of the MVC approach, and allows far more flexible (and friendly) urls than, say, /questions.aspx?id=12345 (the .aspx here is for illustration only; in reality we use razor (.cshtml) for the view).

I'm not sure it is, really. URL re-writing would mainly apply when re-mapping "friendly" URLs to the underlying paths. In the case of MVC there is no such underlying path.
–
Marc Gravell♦Sep 1 '11 at 8:40

Well, since @Nikhil only mentions asp.net and not MVC, I assumed he'd simply like to add pretty URL's to an existing site, where rewriting comes in handy.
–
CodeCasterSep 1 '11 at 8:49

the question was edited; it was originally phrased "or any other method?" - but indeed, URL rewriting would count as an "other method" useful for different scenarios (with a similar aim).
–
Marc Gravell♦Sep 1 '11 at 8:54

I'm not sure it is, really. URL re-writing would mainly apply when re-mapping "friendly" URLs to the underlying paths. In the case of MVC there is no such underlying path.
–
Marc Gravell♦Sep 1 '11 at 8:40

offtopic
In a web site that uses same url scheme, the user was not redirected to the correct url, if the url was mistyped after the question id (or for example the title has changed - example of correct redirect at SO is How does Stack Overflow create its question URLs?). So the client called us and said:

When I rename a product, the old page is not deleted from the hard disk (see www.domain.com/1/test.html - I renamed it to test2, but both pages exists! In this way I'll run off of a disk space very quicly!

Lesson learned: after you fetch the page by it's ID, always make 301 redirect to the correct SE-friendly url if the current url do not match.