<

Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x

Run custom 404 Error pages from IIS 7 and above for Virtual Websites.

Published on
4,320 Points
1,220 Views
1 Endorsement
Last Modified:
Wayne Barron
ASP Classic, VB.NET with SQL Server development. Video Lesson's on Web Development and Video Post Production work. Always fun to share!
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either.
In this article, I will show you how to enable the custom 404 error page, for your site.
When you open IIS7 and above, this is pretty much what you will be faced with.  Which is way different than previous versions of IIS, and in my opinion, a lot better of a layout, and gives more options to work with, especially when dealing with .NET.

Running Windows Professional Workstations, with IIS installed, you are only allowed to run one website.
However, you can run as many Virtual websites as you want or need.
The virtual site will be accessed like so: localhost/spotlight
(Spotlight being the directory name that was assigned to the one shown in the properties image below).

(To setup IIS on your Windows 7 and above Professional workstation, please view the following article.
http:Setting-up-IIS7-5-in-Windows-7-to-run-Classic-ASP-Web-Sites.html )

Windows 10 IIS10
Main.pngThe first thing that we want to do, is choose the []Error Pages] icon in the []IIS] group.
Error-Button.pngThe next page that we are faced with is a list of all available Error pages that you can choose from, to customize.
Error-Pages.pngDouble clicking on the []404] error page line, this will open its properties.
Default-Error-Settings.pngThe first option is checked by default and set in the []Response Action] column.
However, in order to have a custom error page, we will need to point this to a folder located in our website directory. 
So we will choose the option []Execute a URL on this site] (See image below)


Custom-Page.pngLooking at this page, you can see that we are pointing to the following.
/thespotlight.news/error/404.asp
(OR)
/spotlight/error/404.asp
As you can see in the image
IIS.pngAs you can see in the image above, we have 2 different Spotlights. 
One of them is the reference shortcut (This is what we type in to our web browser to access the website)
The other is the website folder. So you can link to either Of these 2 items, in order to setup the custom 404 error page. 

Next we need to set our []Error Response] we do this by []Right] clicking on the 404 error message, and choosing
[]Edit feature Settings]
Right-click-Choose.pngIn the []Edit Error Pages Settings] page, it is set to []Detailed errors] by default, however, we want to change it to []Custom error pages] (or) you can choose the last option if you want to see your errors while designing the site on the production machine, and see the custom error pages while you are on a client machine.

Custom-Error-Pages.pngThat is it.
It is simple to get your 404 error pages up and running on IIS7 and above.
In this example, I am pointing to a Classic ASP 404 error page, however, you can point to any type of page that you have designed to run under your IIS.

Hope this helps someone, as it is very hard to find any information on this anywhere.
It took me some time to finally figure it out, and get it running on my Windows 10 machine.

Thank You
Carrzkiss
1
Comment
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
0 Comments

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Join & Write a Comment

The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Suggested Courses

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month