For SEO reasons we are about to face a major refactoring for a ASP.NET website. To please SEO engines most of .aspx pages will be renamed. The problem is that these pages are referenced all over the web and we absolutely need to avoid to break these links, nor the SEO ranking boost that comes from these links.

Three questions:

A) Is there a common way to handle this?

B) I'd like to centralize in a C# file or an ASP.NET or IIS config file, a redirection table, something defined like:

{ "Page1OldName.aspx", "Page1NewName.aspx" } 
{ "Page2OldName.aspx", "Page2NewName.aspx" } 
{ "Page3OldName.aspx", "Page3NewName.aspx" } 
...

I am aware of the Response.Redirect() method. I can imagine an ugly way to intercept page-not-found error and then use Response.Redirect() coupled with the redirection table, but it doesn't look clean. Is there a cleaner way?

C) Do such redirection could/will provoke SEO ranking penalty?

有帮助吗?

解决方案

you can try to use UrlMapping in webconfig. Test001 is the old url. Test002 is the new.

<system.web>
        <urlMappings>
          <add url="~/test001.aspx" mappedUrl="~/test002.aspx" />
        </urlMappings>
    </system.web>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top