Sunday, March 30, 2014

Redirect non www domain to www in Redirect)

1 comment
In you can set 301 redirect which means redirecting for example to can be done in Application_BeginRequest in Global.ascx file.

This is important from SEO perspective because for crawler and are two different url and which is harmful for site ranking on search engine.

Code for 301 Redirect in in Global.ascx.cs file:

  void Application_BeginRequest()
   if (HttpContext.Current.Request.Url.ToString().Contains(""))
 HttpContext.Current.Response.Status = "Redirect to";


1 comment: