WordPress – IIS 7.5 – URL rewrite – OWA and RWW 403.18 Forbidden

<?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>

This rule is located in my wwwroot folder, it fixes my URL’s, but it breaks my OWA and RWW websites.

How can I add an exception, or condition, to this rule so that it ignores a particular address? I am trying to process the domain name remote.mydomain.com, normally.

Read More

With the rule above in place, remote.mydomain.com, will return a 403 error.

Related posts

Leave a Reply

1 comment

  1. You can simply add a condition to your rule:

    <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" />
            <add input="{HTTP_HOST}" pattern="^remote.mydomain.com$" negate="true" />
        </conditions>
        <action type="Rewrite" url="index.php" />
    </rule>
    

    the condition

    <add input="{HTTP_HOST}" pattern="^remote.mydomain.com$" negate="true" />` 
    

    will prevent your rule from trigger if the requested host is exactly remote.mydomain.com