We are testing interview quizzes and created a demo app. Now, We require your help. Please take this quiz and provide inputs for content improvement. Interview Quiz




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

IIS-Panel

IIS-Panel

  • Right click on your website and select “Add Virtual Directory”.

Virtual Directory

Virtual Directory

  • Provide the directory path in the open dialog box, give an alias name to the directory.

Alias

Alias

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”

Navigation: