IIS: redirect to a webpage if authentication fails

Solution 1:

We managed to figure this out.

In IIS 7.0 the following changes need to be made to get custom HTML error pages to display:

Add the following to the Applications web.config after

<system.webServer>
   <httpErrors errorMode="Custom" existingResponse="Auto" >
    </httpErrors>
</system.webServer>

Then run the command "appcmd unlock config -section:httpErrors" to stop IIS giving a 500 error from these changes