I am in the following situation.
I have IIS 7.5 with an ASP.NET application. The application must run with IIS Classic Mode.
I have one HttpHandler that serves all the Request:
<httpHandlers>
<add verb="*" path="*.aspx" type=".....HandlerFactory..." />
</httpHandlers>
The problem is that i can't establish a Default Document to an non phyisical file. I want that the Default Page be : Home.aspx (which is a non phyisical fi开发者_如何学运维le).
So when I go: www.mysite.com I get an error:
HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory.
I do not want to make a REDIRECT.
Is there any way to accomplish this without having to create a index.html to redirect to Home.aspx?
Thanks in advance!
One option would be to rewrite requests to / to /home.aspx.
The old IIS5/6 trick here is to put a blank default document in the folder -- this will get past the "does the file exist" but your http handler will kick in and take over so said blank document won't be involved.
I'll note this is why ASP.NET MVC ships with a Default.aspx in the root.
If you create a blank Home.aspx file and set it as the default page then IIS will pick this up as your default document, but it will still be processed by your handler.
精彩评论