Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Custom Errors In WebsitePanel/DotNetPanel  (Read 2636 times)

0 Members and 1 Guest are viewing this topic.

sajugovind

  • Guest
Custom Errors In WebsitePanel/DotNetPanel
« on: December 11, 2013, 05:11:35 pm »
We can set customize HTTP error messages that are sent to clients when web server errors occur. It is possible to use generic default HTTP 1.1 errors, detailed custom error files that IIS provides, or create your own custom error files.

We can see "Custom Errors" tab under the website properties. Under the this tab we can below mentioned sections.

Code - all custom error messages display industry-standard HTTP codes, which ensure consistency with HTTP 1.1 error messages. You do not need to change this setting.

Sub Code - displays the Sub Code associated with HTTP Error Codes and does not require any change in normal settings.

Handler Type - the web interface allows you to have your own custom page for different HTTP error codes:

(1) File - type the location of the file mapped to the custom error. It is usually your home location , where you place your files/folders, provided by the web host.

(2) Redirect - to map the custom error to a URL, select URL and enter the path to the URL beginning with the virtual directory name, for example /virdir1/errors/404.htm

Error Content - displays the Redirect/File location, depending upon Handler Type selection.


The Custom error pages such as 400, 401, 403, 404 and 500 that you have setup in DotNetPanel, will not work for any .NET extensions ie: .aspx, asmx etc.

This is because .NET is handling the error page response and not IIS as for other file extensions.

You will need to setup your web.config to handle the needed error codes such as sample code as below for 404 error.

<configuration>
<system.web>
<customErrors mode="On" defaultRedirect="/ErrorPage/404.aspx">
<error statusCode="404" redirect="/ErrorPage/404.aspx" />
</customErrors>
</system.web>
</configuration>
« Last Edit: December 11, 2013, 05:13:27 pm by sajugovind »