Question

Setup: Windows 7, IIS7. I am working on an app that is being viewed through the local IIS server, not the built in debugging web server. So my app url is http://localhost/foo/bar.aspx. There is no <customErrors> section in my web.config, and I haven't changed any settings in IIS.

If any error occurs, I always get the following error screen:

HTTP Error 500.19 - Internal Server Error
Absolute physical path "C:\inetpub\custerr" is not allowed in system.webServer/httpErrors section in web.config file. Use relative path instead.

Here's my applicationhost.config contents:

<httpErrors errorMode="Custom" lockAttributes="allowAbsolutePathsWhenDelegated,defaultPath">
  <error statusCode="401" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="401.htm" />
  <error statusCode="403" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="403.htm" />
  <error statusCode="404" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="404.htm" />
  <error statusCode="405" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="405.htm" />
  <error statusCode="406" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="406.htm" />
  <error statusCode="412" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="412.htm" />
  <error statusCode="500" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="500.htm" />
  <error statusCode="501" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="501.htm" />
  <error statusCode="502" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="502.htm" />
</httpErrors>

How can I get rid of this configuration error so I can see detailed errors?

Was it helpful?

Solution

I've been dealing with this issue for the last few days and found the solution. A Web.Config file is likely specifying an absolute path for one of the error pages. This may not be the Web.Config of the application you are testing. For me, it was the website's Web.Config file.

  1. If you find the offending Web.Config file you can remove the absolute path and the problem should be fixed.

  2. A much easier solution would be to alter your ApplicationHost.Config file to set the allowAbsolutePathsWhenDelegated property to true:

    <httpErrors allowAbsolutePathsWhenDelegated="true" errorMode="Custom" 
                lockAttributes="allowAbsolutePathsWhenDelegated,defaultPath">
    

OTHER TIPS

I had the same problem when I installed Active Directory Certificate Services on the domain controller. Both of them were using port 443. I change the one for certificate services to the server IP Address and left the exchange server unassigned. That solved my problem.

I had this same issue in IIS 8.5. The fix was to delete any entries in the web.config file (located in the root directory of the website) that referenced the custom error pages. The entries were created by the system when I had attempted to make changes to custom pages.

What helped me to resolve this error is setting allowAbsolutePathsWhenDelegated to true.

Go to IIS > Configuration Editor > in Section type: system.webServer/httpErrors and Set allowAbsolutePathsWhenDelegated to true. Reset IIS for good measure.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top