---
title: "Understanding the web.config IIS file"
source: "https://docs.nexcess.com/hosting/server-administration/windows/internet-information-services-iis-your-windows-web-server-guide/understanding-the-web-config-file/"
description: "If your server uses IIS, you can use web.config files to control your website's configuration without editing your server configuration files. You can even appl…"
vertical: "Hosting"
date: "2024-03-04"
last_modified: "2026-07-02"
---

# Understanding the web.config IIS file

The *web.config* files on your IIS server are a great way to control your website’s configuration without editing your server configuration files. You can even apply different settings to different directories within your website.

Creating a *web.config* file is easily accomplished by creating a plaintext file and uploading it to your server. If you have multiple *web.config* files, remember that files higher up in the filepath always take precedence. And, if you want to make a configuration change to your whole server, we recommend editing server-level IIS settings instead. As always, make a backup copy of the configuration file before you make changes to it.

Some common uses for *web.config* files include:

- redirecting URLs to be more easily readable (e.g., mysite.com/product/shirt instead of mysite.com/prodid=1234)
- loading custom error pages (e.g., 404 pages)
- forcing your site to use https instead of http.
- password protecting certain directories
- preventing hotlinking

It is highly recommended that if you are using a server with the Plesk control panel, that you make these changes within the Plesk control panel when possible instead of *web.config* files. If you do decide to make changes to the *web.config* file, you can use the File Manager in Plesk to edit.

For more information on using the web.config file to manage settings, see:

- [Forcing a Secure Connection (SSL) Using web.config in Cloud Sites](https://docs.nexcess.com/hosting/cloud-sites/website-management/ssl/force-a-secure-connection-ssl-using-web-config-in-cloud-sites/)
- [Forcing SSL Connections on Windows Servers](https://docs.nexcess.com/hosting/server-administration/windows/forcing-ssl-connections-on-windows-servers/)
- [Enabling Detailed Error Messages in Windows](https://docs.nexcess.com/hosting/server-administration/windows/enabling-detailed-error-messages-in-windows/)
- [Redirecting URLs and Subdomains in Cloud Sites](https://docs.nexcess.com/hosting/cloud-sites/website-management/redirecting-urls-and-subdomains-in-cloud-sites/)
