Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Manually Adding URLs to the URL Rewriter


I have a couple Web forms on a site that don't correspond to content objects in the system.  So, they're not templates mapped to Page Types, they're just .aspx files sitting in the root of the site.

I'd like to clean up the URLs to these files.  Is there an easy way to add one or two URL patterns to EPiServers' URL re-writer?  I don't want to re-implement the whole thing -- just add a couple patterns to random Web forms.

Sep 09, 2009 21:15

There is 3 different ways you can achieve this:

  1. Use UrlRouting in ASP.NET - simply turn on the httphandler for urlrouting and register the routes on startup.
    Good: Routing is cool and you can match on patterns of urls
    Bad: Requires a bit of coding - Including your own webform handlers
    Read more
  2. The easy way - use the mapping functionality of virtual paths. Turn on the virtualpathmapped provider in web.config and in the mapping section specify source url and destination.
  3. You could also either hook onto the events of the UrlRewriter and do it there - or extend the urlrewriter with your own (that perhaps inherits the current). Not a very clean or nice solution though - and will require a significant amount of error-prone coding.
Edited, Oct 05, 2009 21:09
Nov 05, 2009 12:58
Nov 05, 2009 12:58
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.