Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET webpages without names, like stackoverflow?

Mentioned stackoverflow only as an example, but if you look above the URL for ask is

http://stackoverflow.com/questions/ask

which means /ask is a subdirectory, but they also do this for the specific question pages. How do you code this in .NET?

Not a code question as much as a technique. I know this is great for SEO, but how do you create a site so that every "page" is its own directory? Dynamically.

Do you have a template or a hidden redirect???

How?? :)

like image 572
klkitchens Avatar asked Mar 03 '09 01:03

klkitchens


2 Answers

It's termed URL rewriting:

Url Rewriting with ASP.NET

MSDN: URL Rewriting in ASP.NET

EDIT: As @Justice points out, StackOverflow uses Routing.

like image 147
Mitch Wheat Avatar answered Sep 28 '22 05:09

Mitch Wheat


StackOverflow uses something called Routing, which comes with .NET 3.5 SP1. Routing is a popular feature of a number of MVC frameworks, such as ASP.NET MVC, Ruby on Rails, and a number of Python and PHP frameworks.

like image 34
yfeldblum Avatar answered Sep 28 '22 06:09

yfeldblum