Updated for 8.5 and 10: How to Configure a Custom 404 Error Page in Microsoft IIS Server (2024)

Updated for 8.5 and 10: How to Configure a Custom 404 Error Page in Microsoft IIS Server (1)

The 404 error page is a generic, browser-issued webpage that tells a visitor when a page they are looking for can’t be found. A custom 404 error page, on the other hand, is a specially designed page that delivers the same message but in a more helpful, user-friendly way.

It can tell the visitor what’s going on and what to do next. It can even help save a sale.

This post walks through the steps of how to add an IIS custom error 404 page if you’re a small business administering your own Microsoft IIS server either directly or through a hosting provider. In this post:

  • How to identify your web server
  • How to prepare custom 404 error pages in IIS 8.5
  • How to prepare custom 404 error pages in IIS 10
  • How to test your custom 404 error page
  • Troubleshooting error pages in IIS 8.5 and 10.0

How to Identify Your Web Server

There are several popular (and many more besides) software programs used to store and host webpages, called servers. If you’re not sure which server you use, contact your web host and they’ll tell you.

If they say Apache — and it very well might be since it’s one of the most widely used servers on the web — leave this post and read How to Configure a Custom 404 Error Page — Apache Server Edition.

Not using Apache? There’s a high chance you’re using another very popular server, Microsoft IIS. Another way to tell that you’re using Microsoft IIS is if your website is programmed in .NET or another Microsoft stack, such as ASP.

So you’re using Microsoft IIS? Let’s begin.

Putting in place a custom 404 error page in Microsoft IIS takes four steps:

  1. Design a custom 404 error page.
  2. Put it in the root directory of IIS.
  3. Edit your Microsoft IIS server properties to deliver your custom error page.
  4. Test the page.


This post skips to Step 3. We assume you’ve already created a branded, custom 404 error page. We also assume you’ve put this page in the appropriate directory so that IIS has it available to serve. If that’s correct, then you’re in the right guide.

If you’d like a primer on how to do the first step, visit How to Design a 404 Error Page That Saves a Sale.

A Possible Microsoft IIS Complication

Before diving into the process, it’s important to note a potential complication regarding your IIS web server. If your website resides on a dedicated server (one that isn’t shared), you’re good to go with the steps below.

If your website lives on a shared server run by a third-party hosting provider, only the administrator is allowed to make changes to your server files. In other words, you will have to contact the hosting provider before you can gain access to the server and implement the changes outlined below. Unfortunately, this might take a while – but hopefully it’s a brief setback.

Another way to get administrative rights back in your power if you’re on a shared IIS server is to install an ISAPI_Rewrite plug-in into IIS. ISAPI stands for Internet Server Application Program Interface, and you can easily purchase this software from several places. Helicon Tech (www.isapirewrite.com) creates a good version of the software.

Ready to go? Here’s how to tell your server to replace a generic 404 error with your new and improved page.

How to Program Microsoft IIS to Deliver Your Custom Error Page

With administrative rights to make changes to your server files, you can now get in and make the changes. Exactly how to make those changes depends on the version of the software that you’re using.

Here’s a brief guide for IIS 8.5 followed by another set of instructions for IIS 10.0.

How to Prepare Custom 404 Error Pages in IIS 8.5

Step 1: Open the “Internet Information Services (IIS) Manager” tab. This is located on the Task Bar below “Server Manager,” and then underneath “Tools.”

Step 2: Identify website or application. Go to the “Connections” pane and click the plus sign (+) next to your server name to expand it. Then expand “Sites.” Next, find the site or application you want to set a custom error page for.

Step 3: Open “Error Pages.” You can do this by double-clicking “Error Pages,” located in the home pane.

Step 5: Enter the HTTP “Status Code.” When you see the dialog box “Add Custom Error Page,” enter “404” underneath “Status Code.”

Step 6: Select “Execute a URL on this site,” located in the same dialog box. This allows you to serve dynamic content, such as an asp file for the custom error page you’ve created.

Step 7: Enter the URL. Within the text box, “File path,” type the URL of the custom error page, and then click “OK.” Note: Make sure when selecting this option that the path is a relative path.

Once you hit “OK,” your custom 404 error page should be live and doing its job.

How to Prepare Custom 404 Error Pages in IIS 10

Step 1: Open the “Internet Information Services (IIS) Manager” tab. This is located on the Task Bar below “Server Manager,” and then underneath “Tools.”

Step 2: Identify website or application. Go to the “Connections” pane and click the plus sign (+) next to your server name to expand it. Then expand “Sites.” Next, go to the site or application you want to set a custom error page for.

Step 3: Open Error Pages. Double-click the “Error Pages” icon located in the home pane; click “Edit.”

Step 4: Enter the HTTP Status Code. When you see the dialog box “Edit Custom Error Page,” enter “404” underneath “Status Code.”

Step 6: Select “Execute a URL on this Site.” In the same dialog box, select “Execute a URL on this site” so that you can serve your custom page.

Step 7: Enter the URL. Within the text box “URL (relative to the site root),” type the URL of the custom error page and then click “OK.”

Step 8: Select “Edit Feature Settings.” Once you hit “OK,” right-click on the 404 error and select “Edit Feature Settings.”

Step 9: Choose “Custom Error Page,” and then click “OK.” After you click this last OK, your new page should be live and ready.

Test Your New and Improved Custom 404 Error Page

Whether you’re using IIS version 8.5 or 10.0, it’s time to check if your new page is working properly. The easiest way to test your new page is to visit a bogus page on your website. Go to your web browser and type in a fake page on the site, such as www.mywebsite.com/bogus-cheeseburgers.

If the new custom page comes up, congratulations! You’ve properly set up a custom 404 error page for the Microsoft IIS server.

If you’re still getting the generic 404 error page, it’s time to check a common problem and try again.

Troubleshooting in IIS 8.5 and 10.0

  • Did you use an absolute path instead of a relative path? It has to be a relative path. This is a common issue that plagues both IIS 8.5 and 10.0. To fix this issue, simply go back to Step 6 and add a relative path. And test again. Hopefully this time you’ll find your custom page live and ready.
  • Are you not seeing the admin menus described here? It may be that you don’t have administrative access. If for some reason you cannot get admin access, there is an alternative: you can configure your custom 404 page manually by editing the Web.config file or putting it in code. Here’s where Microsoft offers steps on how to do both.

Note: If your website is programmed in something other than C#, VB.NET, JavaScript or VBScript, you can still use the steps outlined above, but you’ll have to learn how to do it depending on your programming language/framework.

Simple Change, Big Results

No one enjoys getting a bite of something they don’t want. From a visitor’s point of view, coming across a 404 error page on your website is disappointing and confusing.

And depending on what they get instead of what they wanted, a visitor can lose their appetite. In fact, it’s not uncommon for a consumer who encounters a 404 error page to immediately click the back button and exit the site completely.

A sad ending to a potential conversion.

The good news is that a custom error 404 can save the day.

While it might not be the main course that your visitors are craving, a custom error page can serve as the amuse-bouche that opens their appetites and leads them to the final entrée.

Help your hungry visitors get over the disappointment of reaching a generic error by creating and setting up a custom 404 page.

Adding a custom 404 error page is just one of the best practices in SEO. There’s so much more to learn, and you can do just that through our official Bruce Clay SEO Training course.

Melanie Saxe was a senior content writer for Bruce Clay Inc. She holds a B.A. degree in journalism and has many years of experience crafting content for the web. When she's not writing at work, she’s usually playing Legos with her son, tinkering with her poems, or singing jazzy songs.

See Melanie's author page for links to connect on social media.

Updated for 8.5 and 10: How to Configure a Custom 404 Error Page in Microsoft IIS Server (5)

Updated for 8.5 and 10: How to Configure a Custom 404 Error Page in Microsoft IIS Server (2024)

FAQs

Updated for 8.5 and 10: How to Configure a Custom 404 Error Page in Microsoft IIS Server? ›

To resolve this problem, verify that the file requested in the browser's URL exists on the IIS computer and that it is in the correct location. Use the IIS Microsoft Management Console (MMC) snap-in to determine where the file requested must exist in the IIS computer's file system.

How to handle 404 error in IIS? ›

To resolve this problem, verify that the file requested in the browser's URL exists on the IIS computer and that it is in the correct location. Use the IIS Microsoft Management Console (MMC) snap-in to determine where the file requested must exist in the IIS computer's file system.

How do I create a custom error? ›

Custom errors can be constructed in two ways, which are:
  1. Class constructor extending error class.
  2. Function constructor inheriting error class.
Aug 22, 2022

How do I set custom error mode in web config? ›

To configure the custom errors mode, perform the following:
  1. Open your web.config file.
  2. Inside the <system. web> section, change the <customErrors> tag in one of the following ways: <customErrors mode="Off" /> <customErrors mode="RemoteOnly" /> <customErrors mode="On" />
  3. Save and close the web. config .

What is a custom error page? ›

Custom error pages enable you to customize the pages that display when an error occurs. This makes your website appear more professional and also prevents visitors from leaving your site. If a visitor sees a generic error page, they are likely to leave your site.

What is custom 404? ›

A custom 404 page takes away the confusion of not landing on the page they had intended to land on. It lets your user know that there is an error with their request. Perhaps they mistyped the URL, the page is temporarily unavailable, or the page no longer exists.

What should I avoid in a custom 404 page? ›

While designing the custom 404 error page, there are some things that you should avoid. Never redirect the 404 errors to a different website. Remember the goal of the custom 404 is to improve your visitor's experience. Sending them to a totally different website will frustrate them.

Why is my 404 page not showing? ›

404 not found is a HTTP status code error that indicates the specific page you are trying to visit is non-existent. Usually, it occurs when the domain points to an incorrect DNS address, files or folders have misconfigured permissions, or the system runs a corrupt . htaccess file.

How do I customize pages shown by error handler? ›

You can develop your own scripts to customize the pages shown by the error handler when an error is encountered. To do this you use AEM's standard overlay mechanism so that your customized pages are created under /apps and overlay the default pages that are under /libs .

How to show server error in IIS? ›

To Enable detailed IIS Error messages:

Open Internet Information Services (IIS) Manager. Select "Error Pages" Select "Edit Feature Settings" Select "Detailed Errors"

How do I get error code 404? ›

You'll get 404 errors if you've deleted or removed pages from your site recently without redirecting their URLs. 404 errors can also occur if you've relaunched or transferred your domain and failed to redirect all your old URLs to the new site.

How to handle HTTP error 404.0 not found in asp net? ›

There are a lot of ways to handle 404 NotFound error and ASP NET 404 error handling is pretty straightforward. You can set the custom error mode to “On” from your project's web. config then you can specify a redirect to a specific method to handle the error.

How do you create a customized error alert? ›

You can provide your own error message and also allow people to type their own values. Here's how: Select the cells you want. Click Data Validation. Click the Error Alert tab and check the box.

How to display custom 404 error page in asp net MVC? ›

To set up a 404 error page, you need to do the following steps:
  1. Set up the error handling via IIS in the Global. asax file. ...
  2. Create a 404 Not Found page as: an MVC page. ...
  3. Add an httpErrors element that specifies the path to your 404 page to the project's Web. config file.
Feb 26, 2019

How do I redirect a 404 page in HTML? ›

Install and activate a Redirection plugin to do this one-by-one operation.
  1. In Tools > Redirection > Add new redirection.
  2. In the Source URL box, type or paste the broken/old/altered URL.
  3. In the Target URL box, type or paste the new URL.
  4. Opt for URL and referrer in the match drop down.
  5. In the Action box, chose Redirect to URL.
Mar 27, 2020

Which statement allows you to create a custom error? ›

The throw statement allows you to create a custom error. Technically you can throw an exception (throw an error). If you use throw together with try and catch , you can control program flow and generate custom error messages.

Which keyword allows you to create any custom error? ›

The new keyword signifies a constructor for a new error object.

Which function is used to create the custom error handler? ›

The set_error_handler() function sets a user-defined error handler function.

How do I create a custom section in web config? ›

4 Easy Steps to Custom Sections in web. config
  1. Define the xml markup needed by your custom section. Think about all the options and attributes needed by each item. ...
  2. The IT Leader's Guide to Multicloud Readiness. ...
  3. Declare the handler at the top of the web. ...
  4. Use the data from the custom section in your code.
Jan 5, 2017

What is the default mode of custom error section? ›

RemoteOnly: Specifies that custom errors are shown only to remote clients, and ASP.NET errors are shown to the localhost. This is the default.

What is the difference between custom error and HTTP error? ›

customErrors are a legacy (backwards compatable) element, used by Visual Studio Development Server (aka. VSDS or Cassini). httpErrors are the new element which is only used by IIS7. This highlights the possible problem when developing ASP.NET websites while using VSDS instead of the local IIS.

How do I create a 404 redirect? ›

Go to “Tools” on the left side of the dashboard and select “Redirection.” Scroll down to “Add new redirection.” Paste the URL you obtained from Google Search Console into the “Source URL” field. Type or paste the URL of your custom 404 page into the “Target URL” field.

How do I edit a 404 page? ›

To customize this page, simply navigate to Appearance > Theme Editor in your admin dashboard. In the list of theme files along the right side of the page, choose 404. php. Here, edit the message text as you want then save your changes.

What is the best practice 404 error page? ›

The best practice is to design a 404 page with a handful of key links, including a link to the Home page as an easy get-out for users who're not sure what they're looking for yet. Other options to include might be to a blog, product features or About Us page.

What should 404 page URL be? ›

A 404 page should be similar to other pages of the website, except for the textual content. And that makes sense because the main goal of this page is to inform users that even when the page is missing, they are still on the same website and everything's going to be fine.

What is the best designed 404 page? ›

SeedProd is hands down the BEST 404 page and landing page builder for WordPress. It's easy to get started and doesn't require any code at all. That's because this plugin comes with ready-made 404 page templates and a visual drag and drop builder.

Why is my homepage 404 not working? ›

The 404 error is an HTTP response code that occurs when the server cannot find the file or page requested by the user. In response, the web hosting server automatically sends the user an error message, “404 Not Found“. The WordPress 404 error commonly occurs when: You've newly migrated your site to a new host.

Do 404 errors go away? ›

Other methods might not work or work as quickly to get the page to go away from Google search results. However, if the page that now results in a 404 had great SEO for your website, when a 404 happens, your site doesn't get any of that SEO value. It fades away when a 404 takes hold.

How do I find 404 pages on my website? ›

Google Search Console: You will find a list of all 404 pages by logging into your Google search console account and going to Diagnostics > Crawl Errors. After you click on “Not Found”, a list of all the urls that result in a 404 error will appear. You're in luck if you're running a WordPress-based website.

What is the error page system path? ›

error-page. system-path is the absolute path to system Error page resource to serve if no other more appropriate error pages can be found. Does not include extension.

In which environment would you want to display diagnostic error pages? ›

However, we want our error page to display when an error occurs in the production environment. The simplest way to do this by taking advantage of dependency injection in the Startup class.

Where is IIS default error page? ›

By default, IIS serves error messages defined in files stored in the %SystemRoot%\Help\IisHelp\Common folder. You can create a custom error message for users and configure IIS to return this page whenever it encounters a specific HTTP error on your site.

How do I check IIS configuration? ›

To check IIS settings for the Web application
  1. Open the Administrative Tools window: On the Start menu, point to Programs, and then click Administrative Tools. ...
  2. In the dialog box, click the tree control node for your machine. ...
  3. Right-click the Web application, and on the shortcut menu, click Properties.
Mar 9, 2023

How do I access IIS configuration? ›

Accessing Configuration Information
  1. In IIS Manager, double-click either Internet Information Services or (local computer).
  2. Click the Action menu item and click Connect. ...
  3. In the Computer Name text box, type the name of the computer to which you want to connect. ...
  4. Click OK.
Jun 16, 2017

What is 404 default error? ›

The 404 page error code means a server could not find a client-requested webpage. They're generated when a user attempts to access a webpage that doesn't exist, has been moved or has a dead or broken link.

What is the default backend 404? ›

HTTP 404 Not Found is an HTTP status code that indicates that the host has been able to communicate with the server, but the requested resource does not exist.

What is error 404 unable to resolve the request? ›

A HTTP 404 error happens when a resource is unavailable. The client (web browser) received a message from the server (remote computer) that the specific resource (web page/URL) is unavailable.

What is HTTP error 404.0 not found in IIS Express? ›

HTTP Error 404.0 - Not Found The resource you are looking for has been removed, had its name changed, or is temporarily unavailable. Most likely causes: The directory or file specified does not exist on the Web server. The URL contains a typographical error.

What is 404 URL not found on server? ›

The HTTP 404 Not Found response status code indicates that the server cannot find the requested resource. Links that lead to a 404 page are often called broken or dead links and can be subject to link rot. A 404 status code only indicates that the resource is missing: not whether the absence is temporary or permanent.

How to set 404 error page in asp net? ›

Create a folder in your “Pages” folder called “errors”. Inside the “errors” folder you can then add a razor page called 404. cshtml. You can make this file look exactly how you want to.

Which function is used to create custom errors? ›

Custom errors, on the other hand, are generated by T-SQL custom codes based on your code or business logic. To add a custom error message to sys. messages, the stored procedure sp_addmessage is used.

How do I add a rewrite rule in IIS? ›

Creating a rewrite rule
  1. Go to IIS Manager.
  2. Select Default Web Site.
  3. In the Feature View click URL Rewrite.
  4. In the Actions pane on the right-hand side, click Add rules…
  5. In the Add Rules dialog box, select Blank Rule and click OK.
Mar 22, 2022

Which of the following extension method allows us to configure custom error? ›

The UseExceptionHandler extension method allows us to configure custom error handling route.

Which keyword is used to display a custom error message? ›

The keyword "raise" is used to display a customised error message to the user. The keyword "raise" is used to display a customised error message to the user. This is useful when you want to display a specific error message to the user, rather than the default error message.

Which keyword is used to display a Customised error message to the user? ›

The raise keyword is used to raise an exception. You can define what kind of error to raise, and the text to print to the user.

Which of the following attribute of the custom error section is used to show custom error page in asp net? ›

The <customErrors> section in Web. config has two attributes that affect what error page is shown: defaultRedirect and mode . The defaultRedirect attribute is optional. If provided, it specifies the URL of the custom error page and indicates that the custom error page should be shown instead of the Runtime Error YSOD.

How do I enable custom errors? ›

To configure the custom errors mode, perform the following:
  1. Open your web.config file.
  2. Inside the <system. web> section, change the <customErrors> tag in one of the following ways: <customErrors mode="Off" /> <customErrors mode="RemoteOnly" /> <customErrors mode="On" />
  3. Save and close the web. config .

Which function is used to implement error handling? ›

This can be done by adding the RAISERROR function so we can throw our own version of the error.

How do I add a custom module in IIS? ›

How To
  1. Open Internet Information Services (IIS) Manager: ...
  2. In the Connections pane, expand the server name, expand Sites, and then go to the Web site or application to which you want to add a managed module.
  3. In the Home pane, double-click Modules.
  4. In the Actions pane, click Add Managed Module.
Mar 21, 2022

What is the difference between redirect and rewrite in IIS? ›

The Difference Between Redirects and Rewrites

Redirect rules are typically used for old paths that you'd like to redirect to new ones. In contrast, a Rewrite rule does not change the original URL; it simply serves the content of the rule destination at the original path.

How to configure IIS with domain name? ›

Steps to Set a Domain Name to IIS
  1. Under Adjust your computer's settings, click on System and Security. ...
  2. Double-click on your server name, go to Sites and from the top-right hand-side corner, under Actions click on Add Website.
  3. An Add Website window will get displayed as shown below:
  4. Enter your domain name.
Feb 12, 2021

References

Top Articles
Latest Posts
Article information

Author: Duncan Muller

Last Updated:

Views: 5851

Rating: 4.9 / 5 (59 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Duncan Muller

Birthday: 1997-01-13

Address: Apt. 505 914 Phillip Crossroad, O'Konborough, NV 62411

Phone: +8555305800947

Job: Construction Agent

Hobby: Shopping, Table tennis, Snowboarding, Rafting, Motor sports, Homebrewing, Taxidermy

Introduction: My name is Duncan Muller, I am a enchanting, good, gentle, modern, tasty, nice, elegant person who loves writing and wants to share my knowledge and understanding with you.