How to troubleshoot and 404 error in Windows server with IIS

Troubleshooting a 404 error in Windows Server with IIS involves identifying and addressing the root cause of the error, which indicates that the requested resource was not found on the server. 

Here are steps you can take to troubleshoot and resolve a 404 error:

  1. Check the URL:

    • Verify that the URL in the browser is correct and corresponds to an existing resource on the server. Check for any typos or incorrect path components. Sometimes there is a chance that user might be browsing a wrong URL
  2. Review IIS Logs:

    • Check the IIS logs for more information on the 404 error. The logs are typically located in the C:\inetpub\logs\LogFiles directory. Look for the specific entry related to the 404 error to identify the requested URL and the reason for the error. If the 40's are very continuous check if there is any recent deployments, there are chances that the development team might removed that film or missed that file during the deployments. If the file doesnt exists in all the servers under a load balancer then reach out to development team to find whats the cause of removing that file
  3. Verify File Existence:

    • Ensure that the file or resource being requested actually exists on the server. Check the file path and confirm that the file is in the correct location. If the file is missing in only one server, just copy paste the file from its sibling server 
  4. Check IIS Configuration:

    • Verify the IIS configuration for the website or application. Ensure that the site is correctly configured to handle the requested URL, including proper mappings for file extensions and default documents.Also check if the file is having a proper MIME type
  5. Application Pool Configuration:

    • Check the configuration of the application pool associated with the website. Ensure that the correct .NET framework version is selected if your application is based on ASP.NET
  6. URL Rewrite Rules:

    • If you are using URL rewrite rules, check if the rules are correctly configured. Incorrect or misconfigured rewrite rules can lead to 404 errors.
  7. Default Document Configuration:

    • Confirm that the default document for the website or application is set correctly. If a default document is not specified, or if the specified default document is not present, it can result in a 404 error.
  8. Restart IIS and clear the Browser cache:

    • .Also try restarting the IIS and clear the browser cache might helpful in this situations

By systematically going through these steps, you should be able to identify and address the issue causing the 404 error on your Windows Server with IIS.

Post a Comment

Previous Post Next Post