MVC3用以下代码实现全站重定向
复制代码 代码如下:
protected void Application_BeginRequest(object sender, EventArgs e)
{
string strUrl = Request.Url.ToString().Trim().ToLower();
if (strUrl.Contains("http://jb51.net"))
{
Response.RedirectPermanent(strUrl.Replace("http://jb51.net", "https://HdhCmsTestjb51.net"));
}
}
实现如:http://jb51.net/about 重定向到 https://HdhCmsTestjb51.net/about
查看更多关于ASP.NET MVC3 实现全站重定向的简单方法的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did28679