悬赏分:10 浏览:186 次
|
url重定向.
可以使用UrlRewrite组件,像博客园的那种. http://www.cnblogs.com/JeffreyZhao/archive/2008/01/12/url-rewrite-1.html 1.ASP.NET页面静态化,即根据模板在保存时直接生成HTML,网上有很多这样的资料。 2.使用URL重写,参考楼上给出的链接地址,或者看看ScottGu给出的方案: http://blog.joycode.com/scottgu/archive/2007/03/01/94004.aspx 需要在iis里设置,把*.html交给asp.net处理.然后把你所有的aspx文件改名成html文件. 通常,虚拟主机无法完成第一步的.你可以与服务商沟通一下,祝你好运. |
|
1个月前 kaixin110 : void Application_BeginRequest(object sender, EventArgs e) { string fullOrigionalpath = Request.Url.ToString(); if (fullOrigionalpath.Contains("/Products/Books.aspx")) { Context.RewritePath("/Products.aspx?Category=Books"); } else if (fullOrigionalpath.Contains("/Products/DVDs.aspx")) { Context.RewritePath("/Products.aspx?Category=DVDs"); } } 这个方法 如果是一个html文件能执行到这里吗? 我要的效果是这样的 if (fullOrigionalpath.Contains("/100.html")) { Context.RewritePath("/Products.aspx?Category=100"); 不知道HTML文件能不能执行这个 Application_BeginRequest |
|
1个月前 kaixin110 : now getresponsestream save html file ! |