Knowledgebase: Windows Hosting
IIS7 How to enable custom errors in web.config file
Posted by PremiumReseller.com on 10 June 2011 04:50 PM

How to configure Custom Errors on IIS 7.5?

1. Create a custom error page 404.htm and upload to wwwroot folder.

2. Add the following configuration with correct path to 404 error page in your web.config file

<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=301880
  -->
<configuration>


  <system.webServer>
  <httpErrors errorMode="Custom">
  <remove statusCode="404" subStatusCode="-1" />
  <error statusCode="404" subStatusCode="-1" prefixLanguageFilePath="" path="hxxp://yourwebsite.com/404.htm" responseMode="Redirect" />
  </httpErrors>
  </system.webServer>

</configuration>

If you receive any error, please open a ticket with technical support.

(170 vote(s))
This article was helpful
This article was not helpful