2

I have been able to cobble together the following URL Rewrite to get my domain to forward to a sub-directory. It works, but it does not properly redirect to additional sub-directories.

For example:

qa.subdomain.domain.com properly redirects to qa.subdomain.domain.com/subdirectory

However, I want qa.subdomain.domain.com/123456 to redirect to qa.subdomain.domain.com/subdirectory/123456

 <rule name="Pattern Matching" enabled="true" stopProcessing="true">
        <match url="^$/?$" />
        <action type="Redirect" url="subfolder{R:0}{REQUEST_URI}" />
                <conditions>
                    <add input="{HTTP_HOST}" pattern="^(qa\.)?subdomain\.domain\.com" />
                </conditions>
 </rule>

I'm doing this using IIS for an ASP app.

All help is greatly appreciated.

Simon Says
  • 21
  • 2

1 Answers1

0

It seems to me that it should be something as simple as this:

<rule name="Pattern Matching" enabled="true" stopProcessing="true">
 <match url=".*" ignoreCase="true"/>
 <action type="Redirect" url="subfolder/{R:0}" />
 <conditions>
  <add input="{HTTP_HOST}" pattern="^(qa\.)?subdomain\.domain\.com" />
 </conditions>
</rule>
nanestev
  • 822
  • 8
  • 15