ASP.NET Request Paths Reference

I decided to write down and document for myself the different paths provided by ASP.NET, to get a grip on the subject and a reference to turn to.

The path I will be requesting is:
http://www.myurl.com/MyApplication/MyFolder/MyPage.aspx?QueryStringKey=QueryStringValue

This will be an ASP.NET-application named MyApplication in the IIS.

Request-reference

Here is the result returned by the Request-property of the page, which is a HttpRequest.

[Request.ApplicationPath](https://msdn.microsoft.com/en-us/library/system.web.httprequest.applicationpath.aspx):
/MyApplication - Gets the ASP.NET application's virtual application root path on the server.

[Request.AppRelativeCurrentExecutionFilePath](https://msdn.microsoft.com/en-us/library/system.web.httprequest.apprelativecurrentexecutionfilepath.aspx):
/MyFolder/MyPage.aspx _- Gets the virtual path of the application root and makes it relative by using the tilde () notation for the application root (as in "~/page.aspx")._

[Request.CurrentExecutionFilePath](https://msdn.microsoft.com/en-us/library/system.web.httprequest.currentexecutionfilepath.aspx):
/MyApplication/MyFolder/MyPage.aspx - Gets the virtual path of the current request.

[Request.FilePath](https://msdn.microsoft.com/en-us/library/system.web.httprequest.filepath.aspx):
/MyApplication/MyFolder/MyPage.aspx - Gets the virtual path of the current request.

[Request.Path](https://msdn.microsoft.com/en-us/library/system.web.httprequest.path.aspx):
/MyApplication/MyFolder/MyPage.aspx - Gets the virtual path of the current request.

[Request.PathInfo](https://msdn.microsoft.com/en-us/library/system.web.httprequest.pathinfo.aspx):
- Gets additional path information for a resource with a URL extension.

[Request.PhysicalApplicationPath](https://msdn.microsoft.com/en-us/library/system.web.httprequest.physicalapplicationpath.aspx):
C:\Visual Studio Projects\MyApplication\ - Gets the physical file system path of the currently executing server application's root directory.

[Request.PhysicalPath](https://msdn.microsoft.com/en-us/library/system.web.httprequest.physicalpath.aspx):
C:\Visual Studio Projects\MyApplication\MyFolder\MyPage.aspx - Gets the physical file system path corresponding to the requested URL.

[Request.RawUrl](https://msdn.microsoft.com/en-us/library/system.web.httprequest.rawurl.aspx):
/MyApplication/MyFolder/MyPage.aspx?QueryStringKey=QueryStringValue - Gets the ASP.NET application's virtual application root path on the server.

Request.Url-reference

Then there is the property [Request.Url](https://msdn.microsoft.com/en-us/library/system.web.httprequest.url.aspx) that returns a [System.Uri](https://msdn.microsoft.com/en-us/library/system.uri_properties.aspx) , with all its properties. This is an interesting thing to explore as well.

[Request.Url.AbsolutePath](https://msdn.microsoft.com/en-us/library/system.uri.absolutepath.aspx):
/MyApplication/MyFolder/MyPage.aspx - Gets the absolute path of the URI.

[Request.Url.AbsoluteUri](https://msdn.microsoft.com/en-us/library/system.uri.absoluteuri.aspx):
http://www.myurl.com/MyApplication/MyFolder/MyPage.aspx?QueryStringKey=QueryStringValue - Gets the absolute URI.

[Request.Url.DnsSafeHost](https://msdn.microsoft.com/en-us/library/system.uri.dnssafehost.aspx):
www.myurl.com - Gets an unescaped host name that is safe to use for DNS resolution.

[Request.Url.Host](https://msdn.microsoft.com/en-us/library/system.uri.host.aspx):
www.myurl.com - Gets the host component of this instance.

[Request.Url.LocalPath](https://msdn.microsoft.com/en-us/library/system.uri.localpath.aspx):
/MyApplication/MyFolder/MyPage.aspx - Gets a local operating-system representation of a file name.

[Request.Url.OriginalString](https://msdn.microsoft.com/en-us/library/system.uri.originalstring.aspx):
http://www.myurl.com:80/MyApplication/MyFolder/MyPage.aspx?QueryStringKey=QueryStringValue - Gets the original URI string that was passed to the Uri constructor.

[Request.Url.PathAndQuery](https://msdn.microsoft.com/en-us/library/system.uri.pathandquery.aspx):
/MyApplication/MyFolder/MyPage.aspx?QueryStringKey=QueryStringValue - Gets the AbsolutePath and Query properties separated by a question mark (?).

[Request.Url.Query](https://msdn.microsoft.com/en-us/library/system.uri.query.aspx):
?QueryStringKey=QueryStringValue - Gets any query information included in the specified URI.

[Request.Url.ToString()](https://msdn.microsoft.com/en-us/library/system.uri.tostring.aspx):
http://www.myurl.com/MyApplication/MyFolder/MyPage.aspx?QueryStringKey=QueryStringValue - Gets a canonical string representation for the specified Uri instance.

Request also has the property [Request.UrlReferrer](https://msdn.microsoft.com/en-us/library/system.web.httprequest.urlreferrer.aspx) which is of the type System.Uri and has the same properties as Request.Url. It has the following description: Gets information about the URL of the client's previous request that linked to the current URL.

Comments