标签:blog http io ar os sp on div log
void Application_BeginRequest(object sender, EventArgs e)
{
if (HttpContext.Current.Request.Url.ToString().ToLower().Contains("http://domain.com"))
{
// new line here
HttpContext.Current.Response.Clear();
//
HttpContext.Current.Response.Status = "301 Moved Permanently";
HttpContext.Current.Response.AddHeader("Location", Request.Url.ToString().ToLower().Replace("http://domain.com", "http://www.domain.com"));
}
}
301 redirect Domain Name using global.asax
标签:blog http io ar os sp on div log
原文地址:http://www.cnblogs.com/dupeng0811/p/4121426.html