How to configure friendly error pages in Smartsite

Release 1.02 - ...

Error pages in Smartsite are configured through the Smartsite.config file. The Smartsite.config file uses a syntax that is very similar to the one used in ASP.Net to configure error pages in the web.config.

Configure error pages during site development

While developing a site, it can often be convenient to get SXML callstacks and .Net callstack to get information about how and why an error occurs. To get this behaviour, you should turn off friendly error pages.

XML CopyCode image Copy Code
<customErrors handleErrors="true" mode="Off" />

Setting mode to "off" will give you a .Net callstack and an SXML callstack (only when the error occurs while rendering the page) for debugging purposes.

Configure error pages for site deployment

When a site is deployed to a production server, friendly error pages should be turned on. A typical configuration looks like this:

XML CopyCode image Copy Code
<customErrors handleErrors="true" mode="On" defaultRedirect="/Error.html">
 <error statusCode="404" redirect="/FileNotFound.html"/>
 <error statusCode="404" channel="NLD" redirect="/BestandNietGevonden.html"/>
 <error statusCode="404" channel="FRA" redirect="/DocumentNExistePas.html"/>
</customErrors>

Smartsite error pages can be configured per channel. This allows you to create localized error pages. In this example there are two special error pages for the Dutch and French language, there is a friendly error page for 404 errors in all other channels and there is a generic error page (/Error.html) for all other errors.

Do not handle error pages in Smartsite

If you do not wish to handle error pages in Smartsite but let ASP.Net handle them instead, just set the handleErrors attribute to false.

XML CopyCode image Copy Code
<customErrors handleErrors="false" />