1

We are experiencing some issues with our application where the default document (default.aspx) is not being picked up due the the appPool is set to Classic. It appears to be an issue documented here: Site not redirecting to Default Document in Classic pipeline mode

to get around this we are trying to use the IIS URL Rewrite feature.

We want any request which comes to www.example.com/ to go to www.example.com/default.aspx

I used IIS to set it up on the root folder for the application, but i don't see it working, this is what it generated:

<configuration>
<system.webServer>
    <rewrite>
        <rules>
            <rule name="Default Documen Rewrite">
                <match url="/" />
                <conditions>
                    <add input="{QUERY_STRING}" pattern="/" />
                </conditions>
                <action type="Rewrite" url="/default.aspx" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>

EDIT: I just tried the following and it seems to be working, does anyone know if it's correct?

    <rewrite>
  <rules>
    <rule name="Root Hit Redirect" stopProcessing="true">
      <match url="^$" />
      <action type="Redirect" url="mysite/default.aspx" />
    </rule>
  </rules>
</rewrite>
Community
  • 1
  • 1
Paritosh
  • 4,243
  • 7
  • 47
  • 80

0 Answers0