WordPress web.config file

Redirection is one of the important thing in WordPress. WordPress uses .htaccess file to do the redirection process. Windows server not consider .htaccess file. so redirection won’t happen and the site will show 404 page.

But windows server considers web.config file for the redirection process. so we have to create and write our redirection rules in that file.
 
The following is WordPress default redirection rules for 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>

Sarav Author

Comments

  • piesiaCop

    (May 24, 2023 - 4:34 am)

    It has excellent content

  • Davidslons

    (May 28, 2023 - 5:08 am)

    Jia Jia

  • Dennismah

    (June 2, 2023 - 11:01 am)

    cheers

  • Richardfrife

    (June 6, 2023 - 10:49 am)

    good content

  • Toccara Alamia

    (November 12, 2023 - 7:22 pm)

    Hi, I do think this is an excellent site. I stumbledupon it.

Leave a Reply

Your email address will not be published. Required fields are marked *