Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'd like to user 'error.html' for any error IIS may encounter.

If i state the following block in my webconfig the site refuses to run.

<httpErrors errorMode="DetailedLocalOnly" existingResponse="Replace" defaultPath="/error.html" defaultResponseMode="ExecuteURL">
    <remove statusCode="500" subStatusCode="-1" />
    <remove statusCode="404" subStatusCode="-1" />
	<remove statusCode="403" subStatusCode="-1" />
	<remove statusCode="401" subStatusCode="-1" />
	<error statusCode="401" prefixLanguageFilePath="" path="/401.html" responseMode="ExecuteURL" />
    <error statusCode="403" prefixLanguageFilePath="" path="/403.html" responseMode="ExecuteURL" />
    <error statusCode="404" prefixLanguageFilePath="" path="/404.html" responseMode="ExecuteURL" />
    <error statusCode="500" prefixLanguageFilePath="" path="/500.html" responseMode="ExecuteURL" />
</httpErrors>

Notice the Attribute defaultPath="/error.html" in the root element.

I'm getting the following error

HTTP-Fehler 500.19 - Internal Server Error
...
Konfigurationsfehler: Sperrverletzung
...

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

Edit %windir%\system32\inetsrv\config\applicationHost.config

Set the Line:

<httpErrors lockAttributes="allowAbsolutePathsWhenDelegated,defaultPath">

To:

<httpErrors lockAttributes="allowAbsolutePathsWhenDelegated">
share|improve this answer
add comment

Try use the IIS 7 Manager to set this properly. Also, you could maybe do this:

<system.web>
    <customErrors mode="On" defaultRedirect="~/error.html">
    </customErrors>
</system.web>
share|improve this answer
2  
This is for the asp.net config, which works under iis 6 too, right? In IIS 7 is a new Module CustomErrorModule, which works for all errors, not just for Errors generated by asp.net. In short: your solution configures the error handling of asp.net and mine configures error handling of IIS 7 –  Fabian Sep 9 '09 at 8:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.