Skip to content
brad-wechter edited this page Sep 24, 2014 · 7 revisions

To update web.config to use CMS error pages, refer to the following example.

<customErrors mode="On">
  <error statusCode="404" redirect="~/404/" />
  <error statusCode="500" redirect="~/500/" />
</customErrors>

If security is enabled, you can handle forbidden page exceptions by adding a row to the customErrors section, as follows:

<error statusCode="403" redirect="[Access forbidden error url]" />

Note: in the VisualStudio 2012 MVC3 application project, by default, there is registered a global action filter "HandleErrorAttribute", which renders ~/Views/Shared/Error.cshtml on error. If you want to use the "customErrors" redirect from web.config, DO NOT register the "HandleErrorAttribute" filter.

If you want to configure Better CMS to use your own custom 404 error page, update "cms.config" as follows.

<cms pageNotFoundUrl="/404/">[...]</cms>
Clone this wiki locally