IIS7 default document for urlMapped url throws 403 error

Posted by MorningZ on Server Fault See other posts from Server Fault or by MorningZ
Published on 2012-05-31T14:45:27Z Indexed on 2012/05/31 22:43 UTC
Read the original article Hit count: 236

Hopefully this all makes sense:

I have a Web Application project against an IIS7 server that is "theme-able" using different master pages.

As a result of what I am trying to do, the root of the project has no aspx files, so I am using the web.config's ability to rewrite "~/default.aspx" to "~/themes/a/default.aspx"

this works great as long as i type in "http://www.mysite.com/default.aspx", but typing just "http://www.mysite.com" results in a "403 - Forbidden: Access is denied" error

I was hoping that the combination of urlMapping and default document would be smart enough to handle this, but it's not

<system.webServer>
      <defaultDocument enabled="true">
          <files>
              <clear />
              <add value="default.aspx"/>
          </files>
      </defaultDocument>
</system.webServer>

i also tried

<system.webServer>
      <defaultDocument enabled="true">
          <files>
              <clear />
              <add value="~/themes/a/default.aspx"/>
          </files>
      </defaultDocument>
</system.webServer>

to no avail

I was hoping a browser would come in without a document defined, IIS7 would assume it was default.aspx, and then the urlMapping would map it accordingly, but nope

any pointers? I've read a ton of posts here with similar issues, but not the exact issue

© Server Fault or respective owner

Related posts about iis7

Related posts about url-rewriting