2012-08-13

How to set Default Document from web.config file

Apart from setting the default document in IIS, we can directly set the default document for a particular website from the web.config file.

<system.webServer>
  <defaultDocument>
    <files>
      <clear />
      <add value="Test.aspx" />
    </files>
  </defaultDocument>
</system.webServer>

Here, I clear all the other pages in the default document list and add the Test.aspx file to the list.

No comments: