0

My site/application points to a folder called "site" with all permissions set up. In that folder resides "home.asp". Default document is "home.asp". When I go to the domain, I get a "page not found". If I capture that 404 error in IIS and tell it to redirect to "home.asp", everything works. The problem with that is I don't want to redirect all 404's to home.asp. I want the site to default to home.asp and find it. Any ideas why this is happening? Do I need to do something to the .Net side of things to tell it to use the .ASP side of things by default? Do I need to create a .aspx default page that redirects to my "home.asp"? If so, what do I name that page?

Here is my web.config file, in case it gives any ideas:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.web>
        <sessionState timeout="45" />
        <httpRuntime executionTimeout="350" maxRequestLength="1024000000" />
    </system.web>
    <system.webServer>
    <!-- asp runOnEndAnonymously="false" /-->
        <security>
            <requestFiltering allowDoubleEscaping="true">
                <fileExtensions>
                    <remove fileExtension=".asa" />
                </fileExtensions>
                <requestLimits maxAllowedContentLength="1024000000" />
            </requestFiltering>
        </security>
        <staticContent>
            <mimeMap fileExtension=".asp" mimeType="application/asp" />
        </staticContent>
        <defaultDocument>
            <files>
                <remove value="default.aspx" />
                <remove value="iisstart.htm" />
                <remove value="index.html" />
                <remove value="index.htm" />
                <remove value="Default.asp" />
                <remove value="Default.htm" />
                <add value="home.asp" />
            </files>
        </defaultDocument>
        <httpErrors errorMode="DetailedLocalOnly">
            <remove statusCode="404" subStatusCode="-1" />
            <error statusCode="404" prefixLanguageFilePath="" path="/home.asp" responseMode="ExecuteURL" />
        </httpErrors>
        <asp bufferingOn="true">
            <limits bufferingLimit="1024000000" maxRequestEntityAllowed="1024000000" />
            <session timeout="00:40:00" />
        </asp>
        <directoryBrowse enabled="false" />
    </system.webServer>
</configuration>
ScotterMonkey
  • 103
  • 1
  • 5
  • 1
    The fact that the redirect is working means that, by definition, the first request is not the same as the second (otherwise the redirect would cause another 404). Look in your IIS logs to see what the first request looks like versus the redirected one. – Chris McKeown Oct 23 '12 at 21:33
  • Thanks, Chris! I feel kinda "duh" for not thinking of that, ha! :-) – ScotterMonkey Oct 24 '12 at 02:10
  • Assuming that this may have lead you to the solution, I'll post my comment as an answer then :-) – Chris McKeown Oct 24 '12 at 07:52
  • What is the subStatusCode for the 404 on home.asp? Check your logs – Peter Hahndorf Oct 24 '12 at 19:28

1 Answers1

0

[From my comment]

The fact that the redirect is working means that, by definition, the first request is not the same as the second (otherwise the redirect would cause another 404). Look in your IIS logs to see what the first request looks like versus the redirected one

Chris McKeown
  • 7,128
  • 1
  • 17
  • 25
  • Web logs show almost nothing in regard to home.asp. – ScotterMonkey Oct 24 '12 at 19:14
  • Event viewer has tons of choices. Advice on which choices in event viewer to use that may shed light on this issue? – ScotterMonkey Oct 24 '12 at 19:17
  • The IIS logs should at least show the request for home.asp. If they're not, check that logging is actually enabled in IIS on the site that you're looking at – Chris McKeown Oct 24 '12 at 20:30
  • Thanks, Chris. I found the fix. In the application pool for this site I changed .Net version from 4 to 2. – ScotterMonkey Oct 24 '12 at 23:17
  • Bizarre, as far as I know the .NET version should have no bearing on ASP. Perhaps having it set at v4 forced the app pool into integrated mode which probably doesn't work with the classic ASP ISAPI. Doesn't explain why the redirect worked though! – Chris McKeown Oct 25 '12 at 07:39