It is pretty common within web applications to move pages
and other content around over time, which can lead to an accumulation of stale
links in search engines.
In ASP.NET, developers have often handled requests to old
URLs by using the Response.Redirect() method to programmatically forward a
request to the new URL. However, what many developers don’t realize is
that the Response.Redirect() method issues an HTTP 302 Found (temporary
redirect) response, which results in an extra HTTP round trip when users
attempt to access the old URLs. Search engines typically will not follow
across multiple redirection hops – which means using a temporary redirect can
negatively impact your page ranking. You can use the SEO Toolkit to identify places within a site where you
might have this issue.
ASP.NET 4 introduces a new Response.RedirectPermanent(string
url) helper method that can be used to perform a redirect using an HTTP 301
(moved permanently) response. This will cause search engines and other
user agents that recognize permanent redirects to store and use the new URL
that is associated with the content. This will enable your content to be
indexed and your search engine page ranking to improve.
Below is an example of using the new
Response.RedirectPermanent() method to redirect to a specific URL:
ASP.NET 4 also introduces new
Response.RedirectToRoute(string routeName) and Response.RedirectToRoutePermanent(string
routeName) helper methods that can be used to redirect users using either a
temporary or permanent redirect using the URL routing engine. The code
snippets below demonstrate how to issue temporary and permanent redirects to
named routes (that take a category parameter) registered with the URL routing
You can use the above routes and methods for both ASP.NET
Web Forms and ASP.NET MVC based URLs.