URL mapping
The URL mapping attribute uses the configuration information stored in Web.config to remap the received request (remap) to a different URL. The remapping occurs before all other processing operations on the request. The following example shows the remapping of a page request, in which any file type can actually remap the request to a different URL.
To define a remapping URL
The configuration information for URL mappings is stored in web.config. Each element nested in the element defines a rule for the inbound URL that maps into the site. The URL property defines the exact (as-is) attribute of the URL that enters the site, and the URL mapping attribute attempts to match it. If a exact matching operation occurs, the Mappedurl property value is rewritten to the URL that enters the site. Note that this feature does not support more advanced rules (such as matching based on wildcard wildcards expressions expressions).
Example Web.config defines a mapping rule for a large number of URLs. The example used by the Web.sitemap file defines a large number of nodes with URL values that will be mapped. The result is a combination of URL mapping and site navigation that allows developers to define the navigation structure with a friendly URL and use URL mapping to write the request back to a different page to perform the actual process.
When you run the example, note how the menu and TreeView controls display navigation data based on the site structure defined in the Web.sitemap file. If you hover your mouse over a link in the TreeView control or the SiteMapPath control in the upper-right corner, the URL displayed in the status bar is a friendly URL link. When you click on any navigation link, the actual running page is default.aspx. However, navigation information in the menu, TreeView, and SiteMapPath controls is still reflected as a friendly URL structure.
You can also see the values returned by Request.path, request.querystring["category", and Request.rawurl at the bottom of the page. The value returned by Request.path and request.querystring["category" always reflects the result of remapping the URL into the site. However, the Request.rawurl value reflects the friendly URL before the remapping. When the site navigation feature attempts to match the URL information with the data contained in the sitemap file, it uses Request.rawurl. If the matching value is not found, XmlSiteMapProvider the Request.path as a substitute. In the example, all friendly URLs have entries in the Web.sitemap file, so controls that use site navigation always display and reference nodes based on friendly URLs.
The following is a reference fragment:
>