我想将旧地址 www.informarea.it/BlogEngine 重定向到新地址 www.informarea.it...
*我的 blogengine.net 的 global.asax 是 *
void Application_BeginRequest(object source, EventArgs e)
{
HttpApplication app = (HttpApplication)source;
HttpContext context = app.Context;
// Attempt to perform first request initialization
FirstRequestInitialization.Initialize(context);
}
*我可以永久应用重定向代码吗?*
if (app.url.ToString().ToLower().Contains("http://www.informarea.it/BlogEngine"))
{
HttpContext.Current.Response.Status = "301 Moved Permanently";
HttpContext.Current.Response.AddHeader("Location",url.Replace("http://www.informarea.it/blogengine", "http://www.informarea.it"));
}
有人能帮我吗?非常感谢法布里