Posted: 12/8/2011
I am trying to set up 301 redirect so that www.site.com, www.site.com/index.aspx, site.com all point to the same page.
To do that I am using following setting in globle.asax
protected void Application_PreRequestHandlerExecute(Object sender, EventArgs e)
{ string currentUrl = HttpContext.Current.Request.Path.ToLower();
{
string currentUrl = HttpContext.Current.Request.Path.ToLower();
if (currentUrl.StartsWith(http://www.nexthermal.in/Index.aspx))
esponse.Status ="301 Moved Permanently";
Response.AddHeader("Location",
"http://www.nexthermal.in", http://www.nexthermal.in/Index.aspx));
}
how ever page goes infinte loop