protected void Application_BeginRequest(object sender, EventArgs e)
{
string server = Request.ServerVariables["SERVER_NAME"];
if (server != "localhost")
{
if (!Request.Url.ToString().ToLower().Contains("www.") || !Request.Url.ToString().ToLower().Contains("http://"))
{
Response.Redirect("http://www." + server + Request.Path, true);
}
}
}
0 comments:
Post a Comment