0

I have a webiste that runs https. Now some programmers need a subfoder that has no https.

This is what i have in my web.config right now:

<rule name="HTTP Redirect to HTTPS" enabled="true" stopProcessing="true">
    <match url="(.*)" ignoreCase="false" />
    <conditions>
        <add input="{HTTPS}" pattern="off" />
    </conditions>
    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>

We need the folder "wp-content\rest" to be excluded from this https redirect.

In hope someone can help me with this one.

Jan
  • 95
  • 1
  • 6

1 Answers1

0

You need to add an additional condition into your rule:

<rule name="HTTP Redirect to HTTPS" enabled="true" stopProcessing="true">
    <match url="(.*)" ignoreCase="false" />
    <conditions>
        <add input="{HTTPS}" pattern="off" />
        <add input="{REQUEST_URI}" pattern="^/wp-content/rest" negate="true" />
    </conditions>
    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>

Then this rule will disable redirects to all urls like that http://www.example.com/wp-content/rest*

Victor Leontyev
  • 8,488
  • 2
  • 16
  • 36