Iis ошибка 404

Documentation for IIS. Contribute to MicrosoftDocs/iis-docs development by creating an account on GitHub.
title author description ms.date ms.assetid msc.legacyurl msc.type

How to Use HTTP Detailed Errors in IIS 7.0

rick-anderson

Every Web-Site Administrator or Web Developer has seen ‘404 — File not found’, ‘401 — Unauthorized’ or ‘500 — Server Error’ messages in his browser. This ar…

12/12/2007

33897393-97b8-4ee1-836f-25b1348dc3a3

/learn/troubleshoot/diagnosing-http-errors/how-to-use-http-detailed-errors-in-iis

authoredcontent

by IIS Team

Introduction

Every Web-Site Administrator or Web Developer has seen «404 — File not found», «401 — Unauthorized» or «500 — Server Error» messages in his browser. This article helps you understand how and why IIS generates these errors and how they can be configured.

Many might think that generating error messages does not seem to justify a full article. But there is more to errors than meets the eye. Error messages are a sensitive topic, because every error reveals more about your web-site than you might want revealed. The more information someone can gather about your site, the likelier it is that you will be hacked. A search for «google hacking» or «cross-site scripting» reveals a wealth of information on this topic.

However, error messages are also a valuable tool to troubleshoot problems. Developers and Web-Site Administrators require as much detail as possible when an error occurs. Ideally the error message gives recommendations on how to fix the problem. Here is how IIS addresses these fundamentally opposed goals.

Errors, What Errors?

This article talks about HTTP errors as specified in the HTTP RFC (RFC 2616 — section 6.1.1). An HTTP error is always expressed by sending a response with a status code greater than 400 back to the requesting client.

Client Errors

Status codes between 400 and 500 specify an error that the client made, e.g. bad syntax or a request to a resource that doesn’t exist. You can try this by requesting a bogus URL from the web-site of your choice, for example: http://<IIS7Server>/this_resource_does_not_exist. You get a «404 — File not found» error.

Server Errors

Status codes starting with 500 are errors caused by the server. The most common causes for 500 errors on IIS systems are:

  • An ASP or ASPX page that contains a syntax error
  • The web server configuration or the application configuration cannot be read or is invalid
  • The site is stopped

It is important to note that browsers like IE often replace errors returned from a web server with their own errors. This makes troubleshooting harder. In IE you can turn this feature off. Go to the «Tools» menu, select «Internet Options», click the «Advanced» tab and find the «Show friendly HTTP error messages» check box and uncheck it. To see the raw response, use HTTP tools like WFETCH in the IIS 6.0 Resource Kit (see «Related Links»).

HTTP Errors in IIS

There are two things that can happen when the httpError module (custerr.dll) encounters an error:

  • A custom error is generated
  • A detailed error is generated

Custom errors are error pages that the regular users of your web-site see. They contain a brief error description of why the error happened, but nothing else. Here is the custom error generated when you request a resource that does not exist, for example: http://<IIS7Server>/this_resource_does_not_exist

Screenshot of the the H T T P Error 404 file or directory not found webpage in Internet Explorer.

Detailed errors are intended for local administrators and developers. They are supposed to provide information that helps to immediately fix the problem. Here is an example of the same request, but now returning a Detailed Error:

Screenshot of the Server Error in Default Web Site Application webpage, showing a Cause and Solution section for the error.

This is dangerous, because Detailed Errors contain information about the inner workings of your web-site. Only trusted personnel should see a Detailed Error. The only way to ensures this is to only generate a detailed error if the request comes from the local machine. As soon as the request is not local, a custom error is generated. Look at the following flow diagram:

Diagram of the Status Substatus, Entity Body, and Set Error's path of creating a detailed error.

Data Flow

First: Error check

The httpError module receives a notification if a response is about to be sent (RQ_SEND_RESPONSE notification). The httpError module checks the status code of this response and immediately returns if the status code is not greater than 400.

Second: Custom Error or Detailed Error

The next check is determined by the request origin (is the request a local or remote request) and the setting of the errorMode property. The errorMode property is set to DetailedLocalOnly, which means that Custom Errors are generated for every remote request. If errorMode is set to «Custom», then all error responses will become Custom Error. If errorMode is set to «Detailed» all error responses will become Detailed Errors. The following table clarifies this behavior:

errorMode Request origin Action
DetailedLocalOnly (default) Local Detailed Error
DetailedLocalOnly (default) Remote Custom Error
Custom Local Custom Error
Custom Remote Custom Error
Detailed Local Detailed Error
Detailed Remote Detailed Error

If the httpError module determines that a Custom Error must be generated, it looks into its configuration to see if it can find a matching error. If a match is found, it sends the static file, redirects the request or executes the URL specified. If no match can be found, IIS send a basic one-line message containing the status code. The next section explains the Custom Error configuration in detail.

If custerr.dll determines that a Detailed Error must be generated, another check is needed. IIS does not touch the response if a module overrode the entity of the response with its own error description. It might contain valuable information. ASP.NET is a good example. The entity of an ASP.NET error response might contain the exception stack and its own error description. A Detailed Error is only generated if the entity body of the response is empty.

<httpErrors> Configuration

Here is the IIS custom error section obtained on a clean install:

[!code-xmlMain]

You see that if the status code of a response is 401, IIS will return a file named 401.htm.

Sub-Status Codes

Many HTTP errors have a sub-status. The IIS default Custom Errors configuration does not differentiate based sub-status codes. It sends the same Custom Error page if you enter the wrong credentials (401.1), or if you get access denied based on invalid rights to access a file (401.3). You can see the different sub-status codes in the log files or via Detailed Errors. Here is a list of the different 404 sub-status codes that IIS produces:

Status Description
404.1 Site could not be found
404.2 Denied by Policy. The request ISAPI or CGI program is not allowed in the Restriction List.
404.3 The static file handler did not have the file in its MimeMap and therefore rejected the request.
404.4 No handler was found to serve the request.
404.5 The Request Filtering Module rejected an URL sequence in the request.
404.6 The Request Filtering Module denied the HTTP verb of the request.
404.7 The Request Filtering module rejected the file extension of the request.
404.8 The Request Filtering module rejected a particular URL segment (characters between two slashes).
404.9 IIS rejected to serve a hidden file.
404.11 The Request Filtering module rejected a request that was double escaped.
404.12 The Request Filtering module rejected a request that contained high bit characters.
404.14 The Request Filtering module rejected a request with a URL that was too long.
404.15 The Request Filtering module rejected a request with a too long query string.
413.1 The Request Filtering module rejected a request that was too long (request + entity body).
431 The Request Filtering module rejected a header that was too long.

You can configure the httpErrors section to show a Custom Error for particular sub-status codes. If you add the following line to the httpErrors configuration section, IIS returns 404_3.htm if a file with a file extension is requested that is not included in the IIS MimeMap (<staticContent> configuration section).

[!code-xmlMain]

Here is how to make the example work:

  1. Add the entry above to your httpErrors configuration section.
  2. Create a file named 404_3.htm in your c:inetpubcusterren-us directory.
  3. Create a file named test.yyy in you c:inetpubwwwroot directory.
  4. Now request http://localhost/test.yyy.

The file extension .yyy is not part of the IIS MimeMap and the static file handler will not serve it.

New in IIS: Language-specific Custom Errors

Each more recent browser includes the language of the client as a request header. Here is an example of how this header might look:

[!code-consoleMain]

The syntax and registry of accepted languages is specified in RFC1766.

When generating an error, IIS takes this header into account when it looks for the custom error file it returns. It generates the path for the custom error using the following logic:

prefixLanguageFilePath configuration setting (for example c:inetpubcusterr)+
Accept-Language header sent by the client (for example en-us) +
Path configuration setting (for example 404.htm)

Example:

If the browser sends a request for an non-existing resource and the «Accept-Language» header has the value of «en-us,» the file that gets returned will be c:inetpubcusterren-us404.htm.

For example, if you are from Germany, you want your error messages in German. To do this, you must install the Windows Vista Language Pack for German. This creates the c:inetpubcusterrde-DE directory with custom error files in it. Now if the browser sends the «Accept-Language» header with the value of «de-DE, the file that gets returned will be c:inetpubcusterrde-DE404.htm.

IIS will always fall back to the system language if the directory «de-DE» does not exist.

[!NOTE]
Internet Explorer allows you to configure the Accept-Language header. Go to «Tools» — «Internet Option», select the «General» tab and click the «Languages» button.

Custom Error Options

In the above examples, IIS sends the contents of the file as the custom error response. IIS has two other ways to respond to an error: by executing an URL or by redirecting the request.

ExecuteUrl

If you want to do more in your custom error, e.g. sending an e-mail or logging the error to a database, you can execute an url. This allows you to execute dynamic content like an ASP.NET page. The example below replaces the 404 custom error. Now IIS executes /404.aspx whenever a 404 error occurs.

[!code-xmlMain]

Security Considerations

A word of caution: For architectural reasons, IIS can only execute the URL if it is located in the same Application Pool. Use the redirect feature to execute a Custom Error in a different Application Pool.

IIS can also return a 302 Redirect to the browser when a particular error occurs. Redirect is good if you have a server farm. For instance, you can redirect all your errors to a central location that you closely monitor.

There is risk however: responseMode=»File» (which is the default) allows you to specify every file on the disk. This will not work if you are very security conscious.

A workable scenario might include only allowing the delegation of the errorMode setting. This enables a developer to receive Detailed Errors for his application even if he is using a remote client. All that is necessary is to set errorMode=»Detailed». Here is how to configure this scenario:

Allow the delegation of the httpErrors section:

[!code-xmlMain]

Second, go to the <httpErrors> section in applicationHost.config and change it so that only errorMode is delegated:

[!code-xmlMain]

Summary

Custom and Detailed Errors are powerful IIS features. They help you to troubleshoot problems without compromising the security of your IIS Server. Many configuration options help you to custom tailor your users’ experience. Most importantly: experimenting with it is fun.

See also

  • Troubleshooting Common IIS Errors
title author description ms.date ms.assetid msc.legacyurl msc.type

How to Use HTTP Detailed Errors in IIS 7.0

rick-anderson

Every Web-Site Administrator or Web Developer has seen ‘404 — File not found’, ‘401 — Unauthorized’ or ‘500 — Server Error’ messages in his browser. This ar…

12/12/2007

33897393-97b8-4ee1-836f-25b1348dc3a3

/learn/troubleshoot/diagnosing-http-errors/how-to-use-http-detailed-errors-in-iis

authoredcontent

by IIS Team

Introduction

Every Web-Site Administrator or Web Developer has seen «404 — File not found», «401 — Unauthorized» or «500 — Server Error» messages in his browser. This article helps you understand how and why IIS generates these errors and how they can be configured.

Many might think that generating error messages does not seem to justify a full article. But there is more to errors than meets the eye. Error messages are a sensitive topic, because every error reveals more about your web-site than you might want revealed. The more information someone can gather about your site, the likelier it is that you will be hacked. A search for «google hacking» or «cross-site scripting» reveals a wealth of information on this topic.

However, error messages are also a valuable tool to troubleshoot problems. Developers and Web-Site Administrators require as much detail as possible when an error occurs. Ideally the error message gives recommendations on how to fix the problem. Here is how IIS addresses these fundamentally opposed goals.

Errors, What Errors?

This article talks about HTTP errors as specified in the HTTP RFC (RFC 2616 — section 6.1.1). An HTTP error is always expressed by sending a response with a status code greater than 400 back to the requesting client.

Client Errors

Status codes between 400 and 500 specify an error that the client made, e.g. bad syntax or a request to a resource that doesn’t exist. You can try this by requesting a bogus URL from the web-site of your choice, for example: http://<IIS7Server>/this_resource_does_not_exist. You get a «404 — File not found» error.

Server Errors

Status codes starting with 500 are errors caused by the server. The most common causes for 500 errors on IIS systems are:

  • An ASP or ASPX page that contains a syntax error
  • The web server configuration or the application configuration cannot be read or is invalid
  • The site is stopped

It is important to note that browsers like IE often replace errors returned from a web server with their own errors. This makes troubleshooting harder. In IE you can turn this feature off. Go to the «Tools» menu, select «Internet Options», click the «Advanced» tab and find the «Show friendly HTTP error messages» check box and uncheck it. To see the raw response, use HTTP tools like WFETCH in the IIS 6.0 Resource Kit (see «Related Links»).

HTTP Errors in IIS

There are two things that can happen when the httpError module (custerr.dll) encounters an error:

  • A custom error is generated
  • A detailed error is generated

Custom errors are error pages that the regular users of your web-site see. They contain a brief error description of why the error happened, but nothing else. Here is the custom error generated when you request a resource that does not exist, for example: http://<IIS7Server>/this_resource_does_not_exist

Screenshot of the the H T T P Error 404 file or directory not found webpage in Internet Explorer.

Detailed errors are intended for local administrators and developers. They are supposed to provide information that helps to immediately fix the problem. Here is an example of the same request, but now returning a Detailed Error:

Screenshot of the Server Error in Default Web Site Application webpage, showing a Cause and Solution section for the error.

This is dangerous, because Detailed Errors contain information about the inner workings of your web-site. Only trusted personnel should see a Detailed Error. The only way to ensures this is to only generate a detailed error if the request comes from the local machine. As soon as the request is not local, a custom error is generated. Look at the following flow diagram:

Diagram of the Status Substatus, Entity Body, and Set Error's path of creating a detailed error.

Data Flow

First: Error check

The httpError module receives a notification if a response is about to be sent (RQ_SEND_RESPONSE notification). The httpError module checks the status code of this response and immediately returns if the status code is not greater than 400.

Second: Custom Error or Detailed Error

The next check is determined by the request origin (is the request a local or remote request) and the setting of the errorMode property. The errorMode property is set to DetailedLocalOnly, which means that Custom Errors are generated for every remote request. If errorMode is set to «Custom», then all error responses will become Custom Error. If errorMode is set to «Detailed» all error responses will become Detailed Errors. The following table clarifies this behavior:

errorMode Request origin Action
DetailedLocalOnly (default) Local Detailed Error
DetailedLocalOnly (default) Remote Custom Error
Custom Local Custom Error
Custom Remote Custom Error
Detailed Local Detailed Error
Detailed Remote Detailed Error

If the httpError module determines that a Custom Error must be generated, it looks into its configuration to see if it can find a matching error. If a match is found, it sends the static file, redirects the request or executes the URL specified. If no match can be found, IIS send a basic one-line message containing the status code. The next section explains the Custom Error configuration in detail.

If custerr.dll determines that a Detailed Error must be generated, another check is needed. IIS does not touch the response if a module overrode the entity of the response with its own error description. It might contain valuable information. ASP.NET is a good example. The entity of an ASP.NET error response might contain the exception stack and its own error description. A Detailed Error is only generated if the entity body of the response is empty.

<httpErrors> Configuration

Here is the IIS custom error section obtained on a clean install:

[!code-xmlMain]

You see that if the status code of a response is 401, IIS will return a file named 401.htm.

Sub-Status Codes

Many HTTP errors have a sub-status. The IIS default Custom Errors configuration does not differentiate based sub-status codes. It sends the same Custom Error page if you enter the wrong credentials (401.1), or if you get access denied based on invalid rights to access a file (401.3). You can see the different sub-status codes in the log files or via Detailed Errors. Here is a list of the different 404 sub-status codes that IIS produces:

Status Description
404.1 Site could not be found
404.2 Denied by Policy. The request ISAPI or CGI program is not allowed in the Restriction List.
404.3 The static file handler did not have the file in its MimeMap and therefore rejected the request.
404.4 No handler was found to serve the request.
404.5 The Request Filtering Module rejected an URL sequence in the request.
404.6 The Request Filtering Module denied the HTTP verb of the request.
404.7 The Request Filtering module rejected the file extension of the request.
404.8 The Request Filtering module rejected a particular URL segment (characters between two slashes).
404.9 IIS rejected to serve a hidden file.
404.11 The Request Filtering module rejected a request that was double escaped.
404.12 The Request Filtering module rejected a request that contained high bit characters.
404.14 The Request Filtering module rejected a request with a URL that was too long.
404.15 The Request Filtering module rejected a request with a too long query string.
413.1 The Request Filtering module rejected a request that was too long (request + entity body).
431 The Request Filtering module rejected a header that was too long.

You can configure the httpErrors section to show a Custom Error for particular sub-status codes. If you add the following line to the httpErrors configuration section, IIS returns 404_3.htm if a file with a file extension is requested that is not included in the IIS MimeMap (<staticContent> configuration section).

[!code-xmlMain]

Here is how to make the example work:

  1. Add the entry above to your httpErrors configuration section.
  2. Create a file named 404_3.htm in your c:inetpubcusterren-us directory.
  3. Create a file named test.yyy in you c:inetpubwwwroot directory.
  4. Now request http://localhost/test.yyy.

The file extension .yyy is not part of the IIS MimeMap and the static file handler will not serve it.

New in IIS: Language-specific Custom Errors

Each more recent browser includes the language of the client as a request header. Here is an example of how this header might look:

[!code-consoleMain]

The syntax and registry of accepted languages is specified in RFC1766.

When generating an error, IIS takes this header into account when it looks for the custom error file it returns. It generates the path for the custom error using the following logic:

prefixLanguageFilePath configuration setting (for example c:inetpubcusterr)+
Accept-Language header sent by the client (for example en-us) +
Path configuration setting (for example 404.htm)

Example:

If the browser sends a request for an non-existing resource and the «Accept-Language» header has the value of «en-us,» the file that gets returned will be c:inetpubcusterren-us404.htm.

For example, if you are from Germany, you want your error messages in German. To do this, you must install the Windows Vista Language Pack for German. This creates the c:inetpubcusterrde-DE directory with custom error files in it. Now if the browser sends the «Accept-Language» header with the value of «de-DE, the file that gets returned will be c:inetpubcusterrde-DE404.htm.

IIS will always fall back to the system language if the directory «de-DE» does not exist.

[!NOTE]
Internet Explorer allows you to configure the Accept-Language header. Go to «Tools» — «Internet Option», select the «General» tab and click the «Languages» button.

Custom Error Options

In the above examples, IIS sends the contents of the file as the custom error response. IIS has two other ways to respond to an error: by executing an URL or by redirecting the request.

ExecuteUrl

If you want to do more in your custom error, e.g. sending an e-mail or logging the error to a database, you can execute an url. This allows you to execute dynamic content like an ASP.NET page. The example below replaces the 404 custom error. Now IIS executes /404.aspx whenever a 404 error occurs.

[!code-xmlMain]

Security Considerations

A word of caution: For architectural reasons, IIS can only execute the URL if it is located in the same Application Pool. Use the redirect feature to execute a Custom Error in a different Application Pool.

IIS can also return a 302 Redirect to the browser when a particular error occurs. Redirect is good if you have a server farm. For instance, you can redirect all your errors to a central location that you closely monitor.

There is risk however: responseMode=»File» (which is the default) allows you to specify every file on the disk. This will not work if you are very security conscious.

A workable scenario might include only allowing the delegation of the errorMode setting. This enables a developer to receive Detailed Errors for his application even if he is using a remote client. All that is necessary is to set errorMode=»Detailed». Here is how to configure this scenario:

Allow the delegation of the httpErrors section:

[!code-xmlMain]

Second, go to the <httpErrors> section in applicationHost.config and change it so that only errorMode is delegated:

[!code-xmlMain]

Summary

Custom and Detailed Errors are powerful IIS features. They help you to troubleshoot problems without compromising the security of your IIS Server. Many configuration options help you to custom tailor your users’ experience. Most importantly: experimenting with it is fun.

See also

  • Troubleshooting Common IIS Errors

I struggled with this, as well. My exact issue was that I had an ASMX Web Service that, when I entered a parameter into a web method and tested it, then it would give me the 404. The particular method had worked fine in the past and hadn’t been changed, only re-published. Then I got here and tried all of the posted answers & nothing helped.

My ultimate solution? I know this is drastic, but I just created a new Visual Studio solution and web project. Selected MVC, then I did an «Add» > «New Item», selected «Visual C#» > «Web» and «Web Service (ASMX)» under that. I copied all of my old code-behind code, then I took note of the namespace it gave the new file in my new project, then pasted all of my old code into the new code-behind file in the new project and put the namespace back to what it had been.

Then I created my folders in my project that I had before using Visual Studio to do «Add» > «New Folder», then copied back in my files into the folders from my other project using Windows Explorer, then right-clicked each folder in Visual Studio and did «Add» > «Existing Item…» and pulled the items in those folders into my new project’s Visual Studio folders. I referenced all my .NET assemblies again, having both projects open so I could compare which ones I had referenced, previously (there were several). I had to name my new project slightly different — basically I did something comparable to «GeneralWebApp» instead of «MyWebApp», for example — so I had to do a «Replace All» in my whole solution to replace that name, so it would get the right namespace for all my files.

Then I did a «Rebuild All» on the project, then started it up with the «Play» button Visual Studio gives when I got it to build correctly. It worked fine. So I published it, and everything was fine on the server where I published it, when I ran it from there. I have no explanation as to what happened, but that’s how I got through it. It’s not a bad test just to see if something Visual Studio is doing has mucked it up.

I have just installed IIS on Windows Server 2008. If I go to localhost, the default page is displayed, so the web server is ok.

I have added a folder with a page in it in the inetpubwwwroot directory. The full path to the page is then C:inetpubwwwrootfolderfile.html.

I have restarted the services but if I navigate to localhost/folder/file.html I get a 404 file not found error.

Obviously I have forgotten something simple, but what is it? :)

asked Apr 14, 2014 at 10:44

user1301428's user avatar

user1301428user1301428

3,28510 gold badges37 silver badges54 bronze badges

12

For anyone that run into this and don’t find the other suggestions effective, also check that Windows is displaying file name extensions. Open Windows Explorer, click «View» in the top bar and then check «File name extensions».

I found that my file was actually named index.html.txt even though it was displaying index.html prior to checking the above setting.

answered Aug 1, 2017 at 21:08

Martin Carstens's user avatar

4

I had this same problem.

Observe your path: C:inetpubwwwrootfolderfile.html.

Ensure that:

  • The file name extension you are requesting (in this case, .html) is not being blocked by IIS.
  • The directories along the path you are requesting (in this case, folder) are not being blocked by IIS.

If you are on Windows 8/ Windows 10, you can check those two things in the IIS Manager desktop application.

Here is how:

  1. Open the IIS Manager. You can type it in the Windows search bar.
  2. In the file tree in the ‘Connections’ box, select the root of web application.
  3. In the Features View that appears in the middle of the screen, select Request Filtering.
  4. In the File Name Extensions tab, ensure that .html does not have the value false.
  5. In the Hidden Segments tab, ensure that NONE of the folders in your path (C:inetpubwwwrootfolderfile.html) are listed.

NOTE: If you cannot see the Request Filtering tool, you may not have enabled all of the IIS features. Search for ‘Turn off windows features’ on your machine. In the Windows Features manager, select all of the boxes in Internet Information Services -> World Wide Web Services and select the box Internet Information Services -> Web Management Tools -> IIS Management Consoles.

answered Sep 19, 2015 at 14:37

scottysseus's user avatar

I’ve had this issue before — I had to set the username and password in again at Anonymous Authentication and it worked perfectly. You can also switch on Detailed errors at Error Pages in IIS to give more info.

answered Apr 14, 2014 at 13:26

Lisa's user avatar

LisaLisa

771 gold badge2 silver badges9 bronze badges

2

Check the following:

  • Find the Authentication Configuration (Anonymous, Basic, Windows, …)
  • Based on the Authentication configuration, check that the account accessing the file (Anonymous, IUSR, SYSTEM, Authenticated Users, …) has enough NTFS permissions
  • Check if the file extension is not filtered in Request Filtering
  • Check if the file extension is explicitly declared in MIME types

answered Nov 23, 2020 at 17:27

Luke's user avatar

LukeLuke

3951 gold badge4 silver badges10 bronze badges

1

I had this same error. My issue was that I accidentally installed another instance of DNN to the same SQL database. I restored a backup of my database to a new database then pointed the config file to the new database. Then both instances worked great.

answered Jul 19, 2018 at 15:52

Nathan Heinrich's user avatar

In the IIS Connections pane, click on the Sites node and check the Status column on the right. In my case, the Default Web Site was stopped and was giving me 404 error.

answered Jun 3, 2019 at 4:44

Matstar's user avatar

I was having the same problem and more. Not only would the html pages not show, but also the images. I noticed the MIME types was not listed in my new computer under the IIS settings and went in and added all the services I could find under Windows Features for IIS. I know its the shotgun approach, and one of those is responsible for the MIME but everything started working correctly once I did this.

answered May 1, 2021 at 15:05

user1324192's user avatar

Problem

IIS 6 Windows 2003 Server default security lock down is very restrictive and prohibits all dynamic content pages. This affects all Cognos cgi executables, notably upfcgi.exe, ppdscgi.exe and login.exe.

When you install IIS, the service is installed in a highly secure and locked mode. By default, IIS serves only static content, which means that features such as Active Server Pages (ASP), ASP.NET, Indexing Service, server-side includes (SSI), Web Distributed Authoring and Versioning (WebDAV), and FrontPage Server Extensions do not work unless you enable them. If you do not enable these features after installing IIS, IIS returns a 404 error. [

HTTP 404.2 File / Page not found

]

Note the presence of suberror 2. This indicates that the lock down did not allow the exe, script or dll to run. Suberror 0 is the traditional «Page not found» error
which can be a source of confusion. Depending on the browser the error could be truncated to just HTTP 404 — the IIS error log files however will show it as 404 2.

Resolving The Problem

To serve dynamic content and unlock these features, you must enable them by
using IIS Manager. Administrators can enable or disable IIS functionality based
on the needs of the organization. Also, if an application extension is not
mapped in IIS, IIS returns a 404 error. To map an application extension, see
‘Setting Application Mappings’ in IIS 6.0 Help. For more information about
troubleshooting 404 errors, see ‘Troubleshooting’ in IIS 6.0 Help.

This error can also occur when importing or running a report with cognos
office connection and the solution is the same.

Related Information

[{«Product»:{«code»:»SSTQPQ»,»label»:»IBM Cognos Series 7 PowerPlay»},»Business Unit»:{«code»:»BU059″,»label»:»IBM Software w/o TPS»},»Component»:»Access Manager»,»Platform»:[{«code»:»PF025″,»label»:»Platform Independent»},{«code»:»PF027″,»label»:»Solaris»},{«code»:»PF033″,»label»:»Windows»}],»Version»:»Access Manager 7.3;Cognos 8 BI Analysis Studio 8.2;Cognos 8 BI Cognos Connection 8.1;Cognos 8 BI Cognos Connection 8.2;Cognos 8 BI Install and Config 8.1;Cognos 8 BI Install and Config 8.2;Cognos 8 BI Query Studio 8.1;Cognos 8 BI Report Studio 8.2;Cognos Metrics Manager 2.2;Cognos Office Connection 1.0;Cognos ReportNet 1.1;Cognos ReportNet 1.1MR2;Cognos ReportNet 1.1MR3;Impromptu Web Reports 7.3;PowerPlay Enterprise Server 7.3;PowerPlay Enterprise Server 7.4;Upfront 7.1″,»Edition»:»»,»Line of Business»:{«code»:»LOB10″,»label»:»Data and AI»}},{«Product»:{«code»:»SSEP7J»,»label»:»Cognos Business Intelligence»},»Business Unit»:{«code»:»BU053″,»label»:»Cloud u0026 Data Platform»},»Component»:»Analysis Studio»,»Platform»:[{«code»:»»,»label»:»»}],»Version»:»»,»Edition»:»»,»Line of Business»:{«code»:»»,»label»:»»}},{«Product»:{«code»:»SSEP7J»,»label»:»Cognos Business Intelligence»},»Business Unit»:{«code»:»BU053″,»label»:»Cloud u0026 Data Platform»},»Component»:»Cognos Connection»,»Platform»:[{«code»:»»,»label»:»»}],»Version»:»»,»Edition»:»»,»Line of Business»:{«code»:»»,»label»:»»}},{«Product»:{«code»:»SSEP7J»,»label»:»Cognos Business Intelligence»},»Business Unit»:{«code»:»BU053″,»label»:»Cloud u0026 Data Platform»},»Component»:»Install and Config»,»Platform»:[{«code»:»»,»label»:»»}],»Version»:»»,»Edition»:»»,»Line of Business»:{«code»:»»,»label»:»»}},{«Product»:{«code»:»SSEP7J»,»label»:»Cognos Business Intelligence»},»Business Unit»:{«code»:»BU053″,»label»:»Cloud u0026 Data Platform»},»Component»:»Query Studio»,»Platform»:[{«code»:»»,»label»:»»}],»Version»:»»,»Edition»:»»,»Line of Business»:{«code»:»»,»label»:»»}},{«Product»:{«code»:»SSEP7J»,»label»:»Cognos Business Intelligence»},»Business Unit»:{«code»:»BU053″,»label»:»Cloud u0026 Data Platform»},»Component»:»Report Studio»,»Platform»:[{«code»:»»,»label»:»»}],»Version»:»»,»Edition»:»»,»Line of Business»:{«code»:»»,»label»:»»}},{«Product»:{«code»:»SSTQPQ»,»label»:»IBM Cognos Series 7 PowerPlay»},»Business Unit»:{«code»:»BU059″,»label»:»IBM Software w/o TPS»},»Component»:»Metrics Manager»,»Platform»:[{«code»:»»,»label»:»»}],»Version»:»»,»Edition»:»»,»Line of Business»:{«code»:»LOB10″,»label»:»Data and AI»}},{«Product»:{«code»:»SUNSET»,»label»:»PRODUCT REMOVED»},»Business Unit»:{«code»:»BU053″,»label»:»Cloud u0026 Data Platform»},»Component»:»Cognos Office Connection»,»Platform»:[{«code»:»»,»label»:»»}],»Version»:»»,»Edition»:»»,»Line of Business»:{«code»:»»,»label»:»»}},{«Product»:{«code»:»SUNSET»,»label»:»PRODUCT REMOVED»},»Business Unit»:{«code»:»BU053″,»label»:»Cloud u0026 Data Platform»},»Component»:»ReportNet»,»Platform»:[{«code»:»»,»label»:»»}],»Version»:»»,»Edition»:»»,»Line of Business»:{«code»:»»,»label»:»»}},{«Product»:{«code»:»SSTQPQ»,»label»:»IBM Cognos Series 7 PowerPlay»},»Business Unit»:{«code»:»BU059″,»label»:»IBM Software w/o TPS»},»Component»:»Impromptu Web Reports»,»Platform»:[{«code»:»»,»label»:»»}],»Version»:»»,»Edition»:»»,»Line of Business»:{«code»:»LOB10″,»label»:»Data and AI»}},{«Product»:{«code»:»SSTQPQ»,»label»:»IBM Cognos Series 7 PowerPlay»},»Business Unit»:{«code»:»BU059″,»label»:»IBM Software w/o TPS»},»Component»:»PowerPlay Enterprise Server»,»Platform»:[{«code»:»»,»label»:»»}],»Version»:»»,»Edition»:»»,»Line of Business»:{«code»:»LOB10″,»label»:»Data and AI»}},{«Product»:{«code»:»SSTQPQ»,»label»:»IBM Cognos Series 7 PowerPlay»},»Business Unit»:{«code»:»BU059″,»label»:»IBM Software w/o TPS»},»Component»:»Upfront»,»Platform»:[{«code»:»»,»label»:»»}],»Version»:»»,»Edition»:»»,»Line of Business»:{«code»:»LOB10″,»label»:»Data and AI»}}]

Historical Number

1000598

404 error served on a plate.

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

Custom 404 Error Page

Photo by Marc Dubois (CC by ND-2.0)

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.

Error page screenshot

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.

Add Custom Error Page Screenshot

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.

Понравилась статья? Поделить с друзьями:
  • Imazing error 105
  • Imax b6ac v2 balance connect error
  • Image failed to verify with access denied что делать lenovo как исправить
  • Image error reset printer samsung scx 4650n
  • Image error reset printer samsung m2070