WordPress web.config file for Windows Plesk

web.config file

Redirection is one of the important things in WordPress. WordPress uses the .htaccess file to perform the redirection process. The Windows server does not consider the .htaccess file. so the redirect will not occur and the site will display a 404 page.

But the Windows server considers the web.config file for the redirection process. so we have to create and write our redirect rules in that file.

The following are the default WordPress redirect rules for the web.config file

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="wordpress" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_URI}" matchType="Pattern" pattern="^/wp-content/" negate="true" />
<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>

 

Related Articles

About author View all posts

Gyanu Basnet