How to add alias and create virtual directory?
There is a term very famous in IIS world ‘virtual directory’, but before discussing a virtual directory, we should be familiar with the term ‘alias’.By definition, an object can have alternative name. If we have a directory like “C:\Projects\Web” , then we can give or specify an alternative name for it like “Web” instead of mentioning full path.
Lets create a project, put the files at the location mentioned above and just a tweak on IIS and voila! virtual directory is ready. So what’s this tweak?
Open your IIS, inetmgr.exe
Right click on your website and select “Add Virtual Directory”.
Provide the directory path in the open dialog box, give an alias name to the directory.
That’s all what is needed to create a virtual directory.
This virtual directory is used with the localhost url like “http://localhost/Web/” to reach out the pages stored in the directory “C:\Projects\Web.”
Note : By Default, “http://locahost” refers to the directory “C:\inetpub\wwwroot”