could u please tell me, how to make 301 permanent redirect in asp.net?
I have written code in Global.asax file but my web client says it is not working,
i have written follwing code in Global.asax file:
protected void Application_BeginRequest(object sender, EventArgs e)
{
if (HttpContext.Current.Request.Url.ToString().ToLower().Contains(
"http://lsatfreedom.com"))
{
HttpContext.Current.Response.Status =
"301 Moved Permanently";
HttpContext.Current.Response.AddHeader("Location",
Request.Url.ToString().ToLower().Replace(
"http://lsatfreedom.com",
"http://www.lsatfreedom.com"));
}
}
Is it useful? Please help.
Thanks