IIS7 Implementation of multiple domain names binding to different default documents in the same physical directory

  • 2020-06-15 10:30:12
  • OfStack

Because there is only 1 web.config per physical directory, and IIS7 writes the default document Settings here, this causes the default document Settings for all domain names to be Shared.

1, enter %windir%\system32\inetsrv\config (%windir% is the installation directory of windows, such as c:\windows)

2. Find the applicationHost. config file, open it with a text editor, copy it and modify it before replacing the original file (it is recommended to backup the original file in case of emergency, which is the working habit).

3. Add the following statement to the last configuration section

4. Delete the default homepage node automatically generated by the website under ES23en. config.


<location path="Shou">
     <system.webServer>
      <defaultDocument enabled="true">
        <files>   
           <clear/>
           <add value="shouindex.aspx"/>
        </files>
      </defaultDocument>
    </system.webServer>
  </location>

Add only sites that need to specifically specify default documents, a few and a few, without the need to restart IIS.
PS: path Is the corresponding site name in IIS.


Related articles: