Request.RawUrl vs. Request.Url

asp.net

Solution

From MSDN:

The raw URL is defined as the part of the URL following the domain information. In the URL string `http://www.contoso.com/articles/recent.aspx`, the raw URL is `/articles/recent.aspx`.

This means, you can use `rawurl` and do not have to care about through which address the server was called (for instance `http://yourserver/` or `http://yourserver.yourdomain.com/` if you have multiple interfaces.)

However, the `URL` property of an `HTTPRequest` object returns a `System.URI` object, which also contains server name.

Problem

What is the difference between `Request.RawUrl` and `Request.Url` in ASP.NET?

Original source