Friday, 16 September 2011

404 Page not working on MODx IIS7.5 web.config

If you are trying to setup MODx Revolution to show a custom 404 error page and are running on IIS7.5 but the web server sends the default local 404 error document to the browser instead check the httpErrors setting in your web.config file:

If you have <httpErrors> try changing the errorMode to Detailed:


<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <httpErrors errorMode="Detailed">
            <remove statusCode="404" subStatusCode="-1" />
            <remove statusCode="405" subStatusCode="-1" />
            <error statusCode="405" prefixLanguageFilePath="" path="405.htm" responseMode="File" />
            <error statusCode="404" prefixLanguageFilePath="" path="404.htm" responseMode="File" />
        </httpErrors>

    </system.webServer>
</configuration>

No comments:

Post a Comment