Your strategic advantage starts here

URL Rewrite Rules for Wordpress and IIS

URL Rewrite Rules for WordPress and IIS

It’s important to use the correct URL Rewrite Rules for WordPress and IIS, otherwise we might see HTTP 404 and HTTP 500 status codes when requesting images and pages.

An example of a working URL rewrite rule is below:

<rules>
    <rule name="Rule 1" stopProcessing="true">
        <match url="^index\.php$" ignoreCase="false"/>
        <action type="None"/>
    </rule>
    <rule name="Rule 2" stopProcessing="true">
        <match url=".*\.(gif|jpg|jpeg|png|css|js)$" ignoreCase="true"/>
        <action type="Rewrite" url="{R:0}"/>
    </rule>
    <rule name="Rule 3" stopProcessing="true">
        <match url="." ignoreCase="false"/>
        <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true"/>
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true"/>
        </conditions>
        <action type="Rewrite" url="/index.php"/>
    </rule>
</rules>
Related Posts
Leave a Reply
Give us a call

Available from 9am to 8pm, Monday to Friday.

Send us a message

Send your message any time you want.

Our usual reply time: 1 Business day
Give us a call

Available from 9am to 8pm, Monday to Friday.

Send us a message

Send your message any time you want.

Our usual reply time: 1 Business day