IIS 7 Custom Error Page Not Showing

As I recreated a production environment on my local development platform, a requirement was to assign a custom 404 Error Page. The web server is IIS (Internet Information Services) 7 on production and development.

In IIS Manager, I’d click the website name, double-click the “Error Pages” icon and then double-click the 404 Status Code row. I would change the “Execute a URL on this site” value for the URL to the 404 ColdFusion page I needed. This exactly replicates what I saw on production.

However, when I would go to the URL I had binded to the site (http://mysite.local), the default IIS error page would show. I checked, rechecked and re-verified the settings to no avail. Then I noticed this “Edit Feature Settings…” link under the Actions menu on the right of the Error Pages page. This is where I found my solution.

Apparently you can get different error displays if you are locally browsing the site as opposed to normal (remote) traffic. Here’s the fix:

  1. Open Internet Information Services (IIS) Manager
  2. Click your website name
  3. Double-click the “Error Pages” icon
  4. Click the “Edit Feature Settings…” link under Actions on the right column
  5. Change the “Error Responses” value to “Custom error pages” (the default is Detailed errors for local requests and custom error pages for remote requests)

The above setting will always display your intended custom error page even if you are browsing locally.

Advertisements

#custom-error-page, #iis