Multiple Headers With Same Name Causing Errors In IIS

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

Profile image of Mattias Geniar

Mattias Geniar, August 27, 2008

Follow me on Twitter as @mattiasgeniar

What if you created a website in IIS, and all of a sudden it shows you the following message in the “status”-column: Cannot create a file when that file already exists. Search all you want, it’s a confusing error – and there’s no problem with a duplicate file whatsoever.

Its a common error in IIS, when a website container won’t start properly and throws a “This web site cannot be started.  Another web site may be using the same port."-error the moment you try to manually start it. Strange error though, since just about every website shares port 80 – and thus uses the same port. The problem however, lies (most likely) in the headers of the website.

Quickly double check the headers by right clicking on the website and choosing properties, in the IIS Manager. Click advanced, next to the IP Address.

See if there are any duplicate headers in there, and remove them if necessary.

Alternatively, you can check the file stored at C:\WINDOWS\system32\inetsrv\MetaBase.xml for any duplicate headers. If you find any, either remove them in the file (any change made there is active straight away), or return to the IIS Manager to solve it through the user interface.



Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.