J
Jeremy S.
I'm developing an ASP.NET 3.5 web application using Visual Studio Pro 2008
on an XP Pro/SP3 dev box using IIS as the Web server.
The app performs url rewriting in global.asax.cs.Application_BeginRequest.
Everything works as intended when a full path, including .aspx page is
requested from the browser. For example:
http://localhost/MySite.testsite.Default.aspx
In this case the logic in Application_BeginRequest logs (for testing
purposes only) the value of Context.Request.Path as:
Context.Request.Path = [/MySite.testsite/Default.aspx]
But there is a problem when the browser does not request a specific .aspx
page and instead requests the site root, like this:
http://localhost/MySite.testsite
or
http://localhost/MySite.testsite/
(notice no specific .aspx page is requested)
In this case Application_BeginRequest doesn't even run, and the browser
immediately receives an HTTP 403 / Forbidden response.
What's going on here? How can I have IIS route requests for the site's root
(e.g., http://localhost/MySite.testsite) to my ASP.NET application, rather
than responding with the 403 Forbidden response? My intent is to have my url
rewriting logic translate requests for the site's root to be treated as
requests for default.aspx.
FWIW: The IIS Console shows Default.aspx is in fact set up as the site's
only default document (under the Documents tab), and the "Enable Default
Document" check box is in fact checked. Also in IIS console, security tab -
Authentication Methods - shows that Anonymous access is checked, in addition
to Integrated Windows Authenticatoin. I would not have both except that
Visual Studio complained when I went to debug - it wanted windows
authentication to be enabled.
Thanks!
on an XP Pro/SP3 dev box using IIS as the Web server.
The app performs url rewriting in global.asax.cs.Application_BeginRequest.
Everything works as intended when a full path, including .aspx page is
requested from the browser. For example:
http://localhost/MySite.testsite.Default.aspx
In this case the logic in Application_BeginRequest logs (for testing
purposes only) the value of Context.Request.Path as:
Context.Request.Path = [/MySite.testsite/Default.aspx]
But there is a problem when the browser does not request a specific .aspx
page and instead requests the site root, like this:
http://localhost/MySite.testsite
or
http://localhost/MySite.testsite/
(notice no specific .aspx page is requested)
In this case Application_BeginRequest doesn't even run, and the browser
immediately receives an HTTP 403 / Forbidden response.
What's going on here? How can I have IIS route requests for the site's root
(e.g., http://localhost/MySite.testsite) to my ASP.NET application, rather
than responding with the 403 Forbidden response? My intent is to have my url
rewriting logic translate requests for the site's root to be treated as
requests for default.aspx.
FWIW: The IIS Console shows Default.aspx is in fact set up as the site's
only default document (under the Documents tab), and the "Enable Default
Document" check box is in fact checked. Also in IIS console, security tab -
Authentication Methods - shows that Anonymous access is checked, in addition
to Integrated Windows Authenticatoin. I would not have both except that
Visual Studio complained when I went to debug - it wanted windows
authentication to be enabled.
Thanks!