Remapping URLs

The simplest way to remap a URL is to specify the remapping in your application’s web configuration file. For example, the web configuration file in Listing 24.1 remaps the Home.aspx page to the Default.aspx page.

Listing 24.1. Web.Config

images

The configuration file in Listing 24.1 contains a <urlMappings> element. This element can contain one or more elements that remap a page from a URL to a mapped Url.

The mappedUrl attribute can contain query strings. However, it cannot contain wildcards. You can use the <urlMappings> element only when performing simple page-to-page mappings.

After you add the web configuration file in Listing ...

Get ASP.NET 4 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.