301从以前的asp版本重定向

我找到了这个。 http://geekswithblogs.net/shahed/archive/2007/10/23/116278.aspx 有些人可以帮我把它组织成一个aspx / aspx.cs文件,因为我对这里的所有代码都不太熟悉。 嗨, 我使用asp.net构建了一个新网站。以前的版本是使用asp构建的。这是问题所在。我的客户希望在具有查询字符串的页面上进行301永久重定向。 如何从我的服务器上不存在的页面重定向,例如。 从 www.example.com/dolls/detail.asp?id=15 至 www.example.com/search_results.aspx?section=Dolls&title=Hat 我已经阅读了一些文章,但他们没有解释如何解决这个特殊问题。 非常感谢, C     
已邀请:
1)Apache:
Redirect 301 /detail.asp?id=15 http://www.mydomain.com/search_results.aspx?section=Dolls&title=Hat
2)IIS:有一个重定向页面。 3)编辑:完整代码:
using System.Web;
public class PermaRedirectHandler : IHttpHandler
{
    public PermaRedirectHandler(){}

    public void ProcessRequest(HttpContext context)
    {
        Response.Status = "301 Moved Permanently";
        Response.RedirectLocation = RedirectionClass.GetRedirectUrl(context);
    }

    public bool IsReusable { get { return false; } }
}
在Web配置中,您将所有以.asp结尾的路径映射到处理程序:
<system.webServer>
  <handlers>
    <add verb="*" path="*.asp" name="redir" type="PermaRedirectHandler" modules="IsapiModule"/>
  ...
  </handlers>
</system.webServer>
你需要一个旧的=>新网址map3ѭ的映射器。你可以用
Dictionary<string, string>
或其他什么。     

要回复问题请先登录注册