Another 404 page issue in IIS 7

I have an existing website that I need to move to IIS 7. The website (which I do not want to rewrite) uses error 404 to serve pages from the database. IOW, a URL like http: // crimson / pages / myPage calls 404, which then goes to the 404.aspx site, which generates html from the database.

In IIS6, I configured the wild card handler associated with aspnet_isapi.dll and mapped 404 to point to my 404.aspx site, and everything worked fine.

I did the same on my new development server with IIS 7 and cannot get it to work.

I am using the Classic.net AppPool application. The lookup handler looks like this:

<add name="WildCardHandler" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv2.0,bitness64" /> 

CustomErrors is as follows:

 <customErrors mode="Off" defaultRedirect="url"> <error statusCode="403" redirect="NoAccess.htm" /> <error statusCode="404" redirect="/site404.aspx" /> </customErrors> 

On the tab of the page with the site’s errors, 404 is displayed on the aspx page and it is set to Run URL

In doing so, I get the following error:

  HTTP Error 404.0 - Not Found
 The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.  Detailed Error Information Module IIS Web Core 
 Notification MapRequestHandler 
 Handler StaticFile 
 Error Code 0x80070002 
 Requested URL http: // srvr: 80 / crimson / articles / index 
 Physical Path C: \ inetpub \ wwwroot \ Crimson \ articles \ index 
 Logon Method Anonymous 
 Logon User Anonymous 

Thank you for understanding.

+4
source share
1 answer

My success!

There is an additional step that should have made it work.

Browse Features> Error Pages> 404> Edit Feature Settings

In the "Edit Error Page Settings" dialog box that appears, select "Custom Error Pages", and then enter the path to the 404 handler and set the path type to "Run URL"

note that

Browse Features> Error Pages> 404> Edit

Gives another dialog box that should also be set to Run URL. Why there are two similar dialogues, both of which are necessary for the work, I do not know. But the way it is.

+2
source

Source: https://habr.com/ru/post/1342342/


All Articles