简体   繁体   中英

Asp.net 3.5 sp1 routing

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.

No, you cannot use the routing feature for asp classic pages redirect. You could configure iis to do this.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM