Overview

Existing WordPress websites hosted on Windows servers need a specific web.config file to function. This is similar to how a Linux hosted WordPress site would need a .htaccess file for pages to load. In this guide we’ll step you through creating the required web.config file for your Windows hosted WordPress website.

Warning

Officially WordPress only supports Linux hosted Apache and nginx:
https://make.wordpress.org/hosting/handbook/server-environment/#web-server
Many plugins and themes are also not compatible with WordPress on Windows environments.

As such Conetix recommends against hosting WordPress on a Windows server.

Instructions

  1. Login to Plesk via your Control Panel area.
  2. Open the File Manager
    how to create a web.config file for wordpress
  3. Navigate to the directory containing the website files:
    In our example the website is located in the default directory “httpdocs”
    how to create a web.config file for wordpress
  4. Create a file called web.config and open it:
    how to create a web.config file for wordpress

Advice

If you’re not sure how to create a file in Plesk, we have a guide below!
https://conetix.com.au/support/how-to-create-a-file-in-plesk-file-manager/

  1. Copy & Paste the below into your new web.config file:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <defaultDocument>
            <files>
                <clear />
                <add value="index.php" />
            </files>
        </defaultDocument>
        <rewrite>
            <rules>
                <clear />
                <rule name="WordPress Rule" stopProcessing="true">
                    <match url=".*" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php" />
                </rule>
            </rules>
            <outboundRules>
                <clear />
            </outboundRules>
        </rewrite>
    </system.webServer>
</configuration>
  1. Save the file:
    how to create a web.config file for wordpress
  2. Test your WordPress website to ensure it’s working.

If you need assistance please don’t hesitate to contact our friendly support team.

Was this article helpful?

Related Articles