Set Default Page For A Website In IIS

In many ASP.NET websites, if we type the website name (like <www.someurl.com>) it will automatically load the page www.<someurl>.com/index.aspx . This is because the “Default Document” feature of IIS was enabled. You can read this article in my blog also.

In this post we are going to see about this feature of IIS and how to configure it in IIS.

  • Open IIS, by type the command “inetmgr” in Run window.
  • Select “Default Document” and click.
  • In the feature view, we can see some type of Document orderly kept.

inetmgr

The top most had the high priority and the last one had least priority.

As per the above figure, the document “Default.htm” had the highest priority, the file “Default.aspx” had the lowest priority. Which means whenever the user types a url (like www.someurl.com), IIS look for the existence of any file in the above order on that Virtual Directory. If it finds any file, it will load that page.

IIS also allow, add/remove the custom default document per website. For example, if we are specifying a page (say home.htm) as the default document which does not exist in the website, then IIS will look into that website and Alert the user as in the following sreenshot, which explicitly state that each time when we type the url, IIS will look in that order.

Default Document

As per the alert, it is advisable to move the default document at the top level, which will increase the performance in the sense IIS can avoid to go further down in the list.

Readers, let me know your thoughts as comment.

X

Build smarter apps with Machine Learning, Bots, Cognitive Services - Start free.

Start Learning Now