//添加301重定向代码
string strURL = "www.comeeu.com";
if (Request.Url.DnsSafeHost != strURL)
{
Response.Clear();
Response.StatusCode = 301;
Response.Status = "301 MovedPermanently";
Response.AddHeader("Location", "http://" + strURL);
Response.End();
}
转载于:https://www.cnblogs.com/litaocnblogs/archive/2013/04/25/3042691.html