Menu

Search

InstantASP Support

Help & Support


Enabling custom error pages within InstantForum or InstantKB


Common Questios

This article explains how to enable ASP.NET custom errors pages within InstantForum. This is helpful if you wish to display your own custom error page should the application encounter a 404 Page Not Found error or 500 Internal Server errors.

It's generally best practice to enable customErrors within any production ASP.NET web application. This can help secure your installation by ensuring sensitive debug information is not rendered to the screen.

To enable customErrors we'll need to modify the web.config file found within the root of your InstantForum installation. Open the web.config file within NotePad and follow the steps below...

1. Change...

<add type="InstantASP.Common.HttpModule.ExceptionModule, InstantASP.Common" name="ExceptionModule" />

To...

<!--
<add type="InstantASP.Common.HttpModule.ExceptionModule, InstantASP.Common" name="ExceptionModule" />
-->

2. Change

<add name="ExceptionModule" type="InstantASP.Common.HttpModule.ExceptionModule"/>
To

<!--
<add name="ExceptionModule" type="InstantASP.Common.HttpModule.ExceptionModule"/>
-->

Basically you are removing our custom exception handler as this overrides the error handling functionality.

3. Within your web.config ensure you handle custom errors..

Classic App Pool

<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="https://www.yoursite.co.uk/500.aspx">
<error statusCode="404" redirect="https://www.yoursite.co.uk/404.aspx"/>
<error statusCode="500" redirect="https://www.yoursite.co.uk/500.aspx"/>
</customErrors>
</system.web>

Integrated App Pool

<system.webServer>
<httpErrors defaultResponseMode="Redirect" errorMode="DetailedLocalOnly">
<error statusCode="404" prefixLanguageFilePath="" path="https://www.yoursite.co.uk/404.aspx" responseMode="Redirect" />
<error statusCode="500" prefixLanguageFilePath="" path="https://www.yoursite.co.uk/500.aspx" responseMode="Redirect" />
</httpErrors>
</system.webServer>

That's It!

If we can assist with any further questions of course please don't hesitate comment below or contact us.


Related Links



Optionally provide private feedback to help us improve this article...

Thank you for your feedback!


Comments require login or registration.

Details

Product: InstantKB, InstantForum
Version: All Versions
Type: HOWTO
Level: Novice
Article not rated yet.
Article has been viewed 8.7K times.
Last Modified: 2 Years Ago
Last Modified By: Ryan Healey

Options

Similar Articles


Tags