如题~~~!
外部访问地址为:
http://www.test.com/demo/default.aspx
(demo/default.aspx实际是不存在的)URL重写后的地址:
http://www.test.com/modules/first.aspx?str=demohttp://www.test.com/demo/default.aspx经过后台重写后可以正常访问
http://www.test.com/modules/first.aspx?str=demo,并且地址栏上显示
http://www.test.com/demo/default.aspx,但当刷新
http://www.test.com/demo/default.aspx的时候,地址栏马上就暴露了真实地址
http://www.test.com/modules/first.aspx?str=demo,这个程序重写URL的其中
一个目的就是隐藏真实的URL,现在偏偏出了这样的问题,麻烦啦!有没哪位高高手可以解决的?

解决方案 »

  1.   

    a common method is to write back the original url in Application_PreRequestHandlerExecuteprivate void Application_PreRequestHandlerExecute(object sender, EventArgs e)
    {
    Context.RewritePath(Context.Request.RawUrl); 
    }or clear the action in a custom form, see
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/urlrewriting.asp
      

  2.   

    http://blog.52forum.com/jyk/archive/2006/02/20/331.htmlURL重写(URLRewriter) 之简化版 
      

  3.   

    思归的回复没看懂,Context是什么类型的变量,是哪里来的?
    可以给我解释一下吗?
      

  4.   

    Context is a member variable of HttpContext type in the current HttpApplication object, you can also use HttpContext.Current object