Get the exact url the user typed into the browser

后端 未结 6 753
轻奢々
轻奢々 2020-12-05 21:42

I would like to get the exact url that user typed into the browser. Of course I could always use something like Request.Url.ToString() but this does not give me

6条回答
  •  独厮守ぢ
    2020-12-05 22:03

    Remember too that the "exact URL that the user entered" may never be available at the server. Each link in the chain from fingers to server can slightly modify the request.

    For example if I type xheo.com into my browser window, IE will be convert to http://www.xheo.com automatically. Then when the request gets to IIS it says to the browser - you really want the default page at http://www.xheo.com/Default.aspx. So the browser responds by asking for the default page.

    Same thing happens with HTTP 30x redirect requests. The server will likely only ever see the final request made by the browser.

提交回复
热议问题