Extensionless URLs in IIS 6

Posted by Jason Marsell on Stack Overflow See other posts from Stack Overflow or by Jason Marsell
Published on 2011-06-24T15:01:59Z Indexed on 2011/06/24 16:22 UTC
Read the original article Hit count: 305

Filed under:
|
|

My client has asked me to build a personalized URL system so that they can send out really short URLs in postcards to customers like this:

www.client.com/JasonSmith03

www.client.com/TonyAdams

With these URLs, I need IIS 6 to trap the incoming request and pass that “JasonSmith03” token to my database to determine which landing page to redirect them to.

I’d love to use an HttpHandler or HttpModule but they both look like they require an file extension (.aspx) in the URL. Wildcard mapping will chew up every incoming request and that’s ridiculous. ISAPI filters are just text routing files, so I can’t employ logic to call the database. According to Scott Guthrie, this would be cake if I had IIS 7, but I don’t.

Can this be done using MVC? I’ve been working with MVP for the last few years, so I haven’t done any MVC and routing. I thought I remembered that MVC has the ability to use REST-style extensionless URLs. I’d be more than happy to have these personalized URLs land on a site that’s built in MVC, if it will work.

Thank you!

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET