Routing Classic ASP Requests To .NET - SEO Redirects

后端 未结 4 1639
梦如初夏
梦如初夏 2021-01-06 05:18

We are replacing an old classic asp website with a .NET 3.5 solution.

We need to redirect all of the classic ASP requests to aspx pages (i.e. contactus.asp, may now

4条回答
  •  借酒劲吻你
    2021-01-06 05:39

    The simplest thing is to use a custom 404 error page at the IIS level. This page can be any ASPX page; you have access to the original request via the HttpContext.

    In IIS 6.0, you'll notice that by default URLs mapped to the .NET engine (.aspx,,asmx etc) use their own 404 handler defined in web.config. No matter; you can cause even those pages to be sent to the IIS 404 page if you edit the ASPX engine mapping and ensure that the tickbox for "file must exist" is set. This redirects all boken links to the IIS 404 handler, even if they are mapped to .NET handlers. People make the mistake of trying to redirect all broken links to the web.config defined 404handler; it's must easier if you just force all to go to the IIS defined one instread.

提交回复
热议问题