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: