Click here to Skip to main content
15,078,238 members
Articles / Web Development / IIS
Tip/Trick
Posted 26 Sep 2016

Tagged as

Stats

31.4K views

IIS Physical Path VS Virtual Path

Rate me:
Please Sign up or sign in to vote.
4.50/5 (4 votes)
26 Sep 2016CPOL
In this tip, we will discuss the differences between IIS Physical path & IIS Virtual path.

First of all, let’s get the overview of both.

Physical path - This is the actual path the file is located by IIS.

Virtual path - This is the logical path to access the file which is pointed to from outside of the IIS application folder.

Let’s display this image from Hard-drive ‘E’ using a virtual directory in IIS Default web site.

iis_0

Add Virtual Directory

iis_1

Here, we need to provide an alias for the physical path.

  • Physical Path: E:\Files
  • Virtual Path: http://localhost/Files/
  • File Name: image_60140ec0-ce46-4dbf-a14f-4210eab7f42c.png
  • Full Path: http://localhost/Files/image_60140ec0-ce46-4dbf-a14f-4210eab7f42c.png

iis_3

iis_4

iis_5

Let’s Enable Directory Browsing

iis_6

By default, this is disabled for security reasons.

iis_7

Here, we can see the files in folder that is in E - drive.

iis_8

Click on the file name, it will load the file which is out of IIS application folder.

iis_9

Thanks for reading. Hope this will help!

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Shamim Uddin
Software Developer Amber Software Solution Ltd.
Bangladesh Bangladesh
Hi, I am Shamim Uddin.Working with Microsoft Technologies.

Comments and Discussions

 
GeneralMy vote of 5 Pin
Shashangka Shekhar28-Sep-16 1:22
professionalShashangka Shekhar28-Sep-16 1:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.