开发者

URL Problem with ASP to ASP.NET

开发者 https://www.devze.com 2023-03-29 11:16 出处:网络
I will transfer a website from CLASSIC ASP to开发者_StackOverflow ASP.NET. My domain name will not change but urls will change For Example: http://www.etkinpatent.com/iso-8-40-iso-9001-nedir.html this

I will transfer a website from CLASSIC ASP to开发者_StackOverflow ASP.NET. My domain name will not change but urls will change For Example: http://www.etkinpatent.com/iso-8-40-iso-9001-nedir.html this link will change to http://www.etkinpatent.com/iso-9001-nedir.html robots will give to my links too much bad points. How can ı solve this problem?


You can use ASP.NET Routing to redirect any url to the page you want.

In your Global.asax file, add something like this (assuming you use ASP.NET 4.0):

void Application_Start(object sender, EventArgs e)
{
    RegisterRoutes(System.Web.Routing.RouteTable.Routes);
}

void RegisterRoutes(System.Web.Routing.RouteCollection routes)
{
    routes.MapPageRoute("OldPageRoute", "oldpage.html", "~/NewPage.aspx");
}

If you now call oldpage.html, you will see the content of NewPage.aspx.

This is a good solution if you want to stick to your old page names. If you would rather use new page names, but are worried about Google, use 301 redirects, like Smirkin Gherkin said in the comments.

0

精彩评论

暂无评论...
验证码 换一张
取 消