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"));
}


}

相关文章:

  • 2022-12-23
  • 2021-10-23
  • 2021-09-04
  • 2021-04-03
  • 2021-10-23
  • 2021-09-13
  • 2022-12-23
  • 2021-12-06
猜你喜欢
  • 2021-07-24
  • 2021-08-11
  • 2021-10-28
  • 2022-12-23
  • 2021-10-05
  • 2021-06-16
相关资源
相似解决方案