How do you create a Vanity URL in .net?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • curtisaallen
    New Member
    • Sep 2010
    • 1

    #1

    How do you create a Vanity URL in .net?

    Hey Guys,

    How do you create a vanity url with dot.net and are there any good tutorial on making vanity url.

    Example: mydomain.com/contact.aspx
    I would like it to be mydomain.com/contact

    thank you,
    Curtis
  • ZiadElmalki
    New Member
    • Sep 2010
    • 43

    #2
    This is with ASP.NET I assume.

    You can with IIS7 in integrated pipeline mode. This lets ASP.NET hook into every request. Otherwise ASP.NET is an ISAPI module and can only handle whatever it is configured for (ASPX, ASHX, ASMX, AXD, etc). This is an option when you configure or create an asp.net apppool.

    You can then use the HttpContext.Rew riteUrl method in an HttpModule or global.asax. Just need to look at the current url from the request and call Rewrite with the actual url to the aspx file.

    I would recommend looking into the ASP.NET MVC framework. It takes care of the pretty URL plumbing via its routes.

    Comment

    Working...