请问如何进行301重定向 最近网站页面内的新闻网址变了,以前的show.aspx?id=123456变成news/123456.html,请问该如何进行301重定向,最好简单方便,通过web.config能实现吗? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你可以在show.aspx里写private void Page_Load(object sender, System.EventArgs e){ Response.Status = "301 Moved Permanently"; Response.AddHeader("Location","news/"+Request.QueryString["id"]+".html");} 也可以在protected void Application_BeginRequest(Object sender, EventArgs e){string sOldPath = HttpContext.Current.Request.Path.ToLower();string sPage = "判断组合新地址";Response.Clear();Response.Status = "301 Moved Permanently";Response.AddHeader("Location",sPage);Response.End();} 还可以在iis里直接配置重定向。iis管理界面里有 问个showmodaldialog窗口使用javascript问题 请教一个问题,关于字体排版..在线等 怎么把一个16进制的图片 还原成图片显示出来 .net 上传图片无法显示 初学CSS的问题 使用DataGrid.Controls查找DataGrid中服务器控件的问题 ----->>>>>>>>>>>一个关于关联下拉菜单的问题,急,高手请帮忙!!!在线等。。。。。。。。。。 这两个个函数是什么意思啊 ?? 小问题 ajax跨域请求无法读写cookie 关于FileUpload控件的问题 DataGrid可以象GridView一样选中某一行吗?
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","news/"+Request.QueryString["id"]+".html");
}
protected void Application_BeginRequest(Object sender, EventArgs e)
{
string sOldPath = HttpContext.Current.Request.Path.ToLower();
string sPage = "判断组合新地址";
Response.Clear();
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location",sPage);
Response.End();
}