I am using url routing feature ( http://msdn.microsoft.com/en-us/magazine/dd347546.aspx ) in my asp.net 3.5 sp1 website. I am wondering that is it same as 301 redirects? what I want is a 301 redirects from my old asp pages to new aspx pages.
2 Answers
The routing you pointed to is a mapping to a page that handles the request. Look at the example:
RouteTable.Routes.Add(
"Recipe",
new Route("recipe/{name}",
new RecipeRouteHandler(
"~/WebForms/RecipeDisplay.aspx")));
What this sets up is taking a URI like http://mysite.com/recipe/grits and routes it to http://mysite.com/WebForms/RecipeDisplay.aspx?name=grits (or similar). This is done server side, not client side, like a 301.
If you want to redirect a user, you need to map that in the server.
Comments
No, you cannot use the routing feature for asp classic pages redirect. You could configure iis to do this.
4 Comments
DotNetUser
I want to make it in the code behind rather than configuring IIS. Is there any other way?
ʞᴉɯ
To use the routing feature for an asp classic page, this should be processed by asp.net engine, and i don't this is possible.
DotNetUser
I want to make it SEO friendly. I mapped my asp page to new aspx but on the url it still shows the asp page url, so for SEO they are still two different pages? Sorry for bothering but I am confused with these things.
ʞᴉɯ
I suggest you to use a different approach: for classic asp you can try a URL Rewrite component such as ISAPI_Rewrite isapirewrite.com