-
Notifications
You must be signed in to change notification settings - Fork 148
Error pages
Audrunas Matonis edited this page Sep 12, 2013
·
7 revisions
Update web.config to use CMS error pages.
<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 such a row to the customErrors section:
<error statusCode="403" redirect="[Access forbidden error url]" />
Note: in VisualSutio 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 customErrors redirects from web.config - you need NOT to register HandleErrorAttribute filter.
If you want to configure CMS to use your custom 404 error page - update cms.config.
<cms pageNotFoundUrl="/404/">[...]</cms>