Article ID: 976111 - Last Review: October 8, 2009 - Revision: 1.0 Introduction to URL rewriting, to URL mapping, and to URL routing in ASP.NET in a .NET Framework environment
On This PageINTRODUCTIONWhen you use Microsoft ASP.NET to develop a Web application, a page may be moved from one directory to another directory. Or, you may map a URL to a page that does not exist. When you try to access this page in a Web browser, you receive an error message that states that the page does not exist. This article describes how to avoid this problem by using the URL Rewriting Engine to perform dynamic URL rewriting, dynamic URL mapping, and dynamic URL routing. MORE INFORMATIONThe URL Rewriting Engine is a sample project that you can download from the Microsoft Download Center. Generally, URL rewriting and URL mapping are used to map a virtual page to a real page. But where URL rewriting is used to map multiple pages according to one rule, URL mapping is used to map a single page. By using URL routing, the URL is not changed when an incoming request is handled, because URL routing can extract values from the URL. When you want to create a URL, you can pass parameter values to a method that generates the URL for you. Usage examplesURL rewritingTo perform URL rewriting, follow these steps:
URL Rewriting in ASP.NET
(http://msdn.microsoft.com/en-us/library/ms972974.aspx)
URL mappingYou can use the <urlMappings> tag in the Web.config file to set up URL mapping.This method is shown in the following code example: urlMappings Element (ASP.NET Settings Schema)
(http://msdn.microsoft.com/en-us/library/ms228302.aspx)
URL routingThe following code example shows how to set up URL routing:ASP.NET MVC Framework (Part 2): URL Routing
(http://weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvc-framework-part-2-url-routing.aspx)
ASP.NET Routing
(http://msdn.microsoft.com/en-us/library/cc668201.aspx)
| Other Resources Other Support Sites
CommunityGet Help NowArticle Translations
|






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email
Back to the top
