0

I am using the Rewrite Module on IIS 7.

When I restart the Application Pool I get a Authentication Required window that doesn't except any credentials that it is given and when you click cancel it goes to a 401 unauthorized page.

The rewrite rule sends the request to an ashx page in a virtual directory (_assets).

How can I resolve this strange behavior?

Anonymous is turned on and it works fine.

The following is the rewrite rule we are using:

<rewrite>
    <rules>
        <rule name="Loader" patternSyntax="ECMAScript" stopProcessing="true">
            <match url="^[a-z0-9\-\/]*$" negate="false" />
  <action type="Rewrite" url="/_assets/includes/load.ashx?q={UrlEncode:{REQUEST_URI}}" appendQueryString="false" />
        </rule>
    </rules>
</rewrite>

I can get past the weird login by going to /.reset. This causes a 500 error and then the site is available again.

Note: Our application pools restart nightly.

iambriansreed
  • 21,935
  • 6
  • 63
  • 79
  • possibly related: http://stackoverflow.com/a/7786839/85371 and especially the linked [article by Phil Haack](http://haacked.com/archive/2011/10/16/the-dangers-of-implementing-recurring-background-tasks-in-asp-net.aspx) which points at [HostingEnvironment.RegisterObject](http://msdn.microsoft.com/en-us/library/system.web.hosting.hostingenvironment.registerobject.aspx) – sehe Apr 06 '13 at 09:31

1 Answers1

1

I found a forum post that outlines a problem pretty similar to yours (it also outlines how they managed to fix it). Hopefully it helps you sort out the issue!

Tim
  • 1,029
  • 7
  • 20