500 Internal Server Error after migrating from IIS 7.5 to IIS 10
by johna | November 4, 2019 | Computers & Internet Web Development Website Hosting
As support ends for Microsoft Windows Server 2008 in January 2020, I have recently gone through migrating some websites to a new server running Windows Server 2016 and IIS 10.
The websites were migrated with the Web Deploy Tool.
Some of the websites did not work, and simply brought up a 500 Internal Server Error, bypassing custom error pages. This is always a sign that the cause of the error might be in the web.config file.
After a little experimenting with commenting out certain sections of the web.config file, I found two sections that had compatibility issues between IIS 7.5 and IIS 10.
The first was the "staticContent" section. I had used this to allow IIS to server .woff and .svg files. This is no longer needed for those types of files in IIS 10 so the section could be removed.
The other problem was where the IIS URL rewrite module had been used to automatically redirect from HTTP to HTTPs.
This module is not installed in IIS 10 by default.
You could download the URL Rewrite extension (https://www.iis.net/downloads/microsoft/url-rewrite) but if you are only using this to redirect from HTTP to HTTPS then IIS 10 has an easier way of doing this:
• Open the IIS console and select the website
• On the "Actions" pane you will see the "HSTS" option below the "Configure" section
• Enable HSTS and "Redirect Http to Https"
(Source: https://www.hametbenoit.info/2018/10/22/windows-server-2019-you-can-now-easily-redirect-http-request-to-https/)
There may be other causes of these problems too but they should be reasonably easy to identify by commenting out sections of the web.config file one at a time and testing, and a little research with your favourite search engine.
Related Posts
Three tips to pay as little as possible when shopping on eBay Australia
by johna | October 29, 2024
There's plenty of cheap items on eBay Australia but sometimes you can pay even less with a little bit of work.
Converting dBase IV programs to run in the browser
by johna | September 13, 2024
Some pointless entertainment trying to get some old dBase programs running in the browser.
How to enable URL rewriting using the Turnkey Linux LAMP stack
by johna | December 27, 2023
An extra part covering URL rewriting for my guide to setting up a website and database using the Turnkey Linux LAMP stack.
Comments
There are no comments yet. Be the first to leave a comment!