Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default Document not trying all files in iis 8.5

I have a website with the default settings for default document on IIS 8.5 Windows 2012 R2.

<system.webServer>
  <defaultDocument enabled="true">
    <files>
      <add value="Default.aspx" />
      <add value="Default.htm" />
      <add value="Default.asp" />
      <add value="index.htm" />
      <add value="index.html" />
      <add value="iisstart.htm" />
    </files>
  </defaultDocument>
</system.webServer>

When I browse to a URL without a file name (mysite.com/Content/) IIS will only try default.aspx and no other files in the list (index.html). IIS tries to load default.aspx and I get a 404. The strange thing is there is no default.aspx file in that directory and index.html does exist. If I browse directly to index.html the page displays properly. According to the Microsoft documentation on default document it should try the next file in the list until it finds one that exists.

I explicitly added a web.config file to the sub directory with

<defaultDocument enabled="true">
  <files>
      <clear />
       <add value="index.html" />
   </files>
 </defaultDocument>

and IIS is still trying to use default.aspx. Has anyone encountered this before? Do you have any suggestions as to why this is not working as documented?

like image 935
Allan Avatar asked Nov 10 '22 14:11

Allan


1 Answers

  1. Try removing/disabling the old URL rewrite module? (temporarily)
  2. If you are requiring authentication, make sure the login page exists.

(other suggestions copied from above, which I have included, in case someone else reads this question)

  1. Check for any routing in the source-code.
  2. Check any special modules or handlers, which might cause redirects or intercept calls.
like image 138
tgolisch Avatar answered Nov 14 '22 22:11

tgolisch