1

Running IIS7 for an asp.net website. I have a subfolder called "test" setup as an application root. I have my test site deployed to that test folder. The root site folder has a webconfig with the following rewrite rules:

<rewrite>
  <rules>
    <rule name="Redirect to HTTPS" enabled="true" stopProcessing="true">
      <match url="(.*)" />
      <conditions>
        <add input="{HTTPS}" pattern="^OFF$" />
      </conditions>
      <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
    </rule>
    <rule name="test.mydomain.com to sub folder" enabled="true" stopProcessing="true">
      <match url="(.*)" ignoreCase="true" />
      <conditions logicalGrouping="MatchAll">
        <add input="{HTTP_HOST}" pattern="^test\.mydomain\.com$" ignoreCase="false" />
        <add input="{PATH_INFO}" pattern="^/test($|/)" negate="true" />
      </conditions>
      <action type="Rewrite" url="\test\{R:0}" />
    </rule>
  </rules>
</rewrite>

When a user enters https://test.mydomain.com/default.aspx I would like to redirect them to the app in the subfolder http://test.mydomain.com/test/default.aspx. This rewrite is not working. I get an error returned by my browser which says:

The page isn't redirecting properly

The URL shown on the error page is https://test.mydomain.com/test/test/test/test/test/test/test/test/test/test/test/test/test/test/test/test/test/test/test/test.

I don't know how much bearing this has, but the SSL was created only for the root site, www.mydomain.com.

Any help would be GREATLY appreciated.

Dave
  • 11
  • 3

1 Answers1

0

Check if the following helps. Let me know if you need help in understanding this.

<rewrite>
    <rules>
        <rule name="sampleRule" stopProcessing="true">
            <match url="test/(.*)" negate="true" />
            <action type="Redirect" url="http://{HTTP_HOST}/test{PATH_INFO}" redirectType="Temporary" />
        </rule>
    </rules>
</rewrite>
Parvez Mulla
  • 111
  • 1