Knowledgebase

Wordpress Web.Config File for Windows

Posted by Ashley Hayward on August 31 2015 04:57 PM

Wordpress, by default, uses an .htaccess file to manipulate how the web server serves files from your website. However, an .htaccess file cannot be read by a Windows server, so you will need to create what is called a web.config file to do the same things the .htaccess would on Linux servers. Below is the base Wordpress web.config file you will need for the site to properly function. You will simply copy the below code into a blank file, then save as "web.config". Upload this file to your Wordpress site's root folder and it should work instantly.

 

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Main Rule" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<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>
</rewrite>
</system.webServer>
</configuration>

(47 vote(s))
This article was helpful
This article was not helpful

Comments (0)
Copyright © 2016 HostMySite