We're currently using ISAPI rewrite. However, we're moving to servers with IIS7 on them. If we're going down the route of using IIS7's url rewriting tool (which, if I remember correctly changes the web.config, which in turn causes an application restart) is there a way to do without causing the application to restart?
Asked
Active
Viewed 9,296 times
1 Answers
2
Yes, the issue isn't with URL Rewrite per se, it's with the new IIS7.x distributed configuration where some settings are delegated to the site's web.config. Any change to web.config will cause an appdomain recycle. Here's a recent video I did on AppDomains.
Your options are:
- Create the rule at the global level. That won't cause the appdomain recycle
- Create the rule manually in applicationHost.config and wrap it in a tag.
- Edit your delegated configuration settings for your server so that the URL Rewrite isn't delegated. Then IIS Manager will automatically place it in applicationHost.config. Be very careful though because existing rules in web.config files will cause sites to fail, so you need to migrate them back to applicationHost.config first.

Scott Forsyth
- 16,449
- 3
- 37
- 56
-
I have tried following this advice using IIS 7.5 but it appears that changes to a rewrite map at global level is still causing the application pool to recycle. At least I'm observing an initial delay on first page load after I change the global rule. Any idea what I might be doing wrong? – Tom Troughton Dec 08 '15 at 17:19
-
2@getsetcode. You're exactly right. That changed with one of the updates of URL Rewrite. Even global level changes cause an appdomain recycle now, and what's worse is that it causes it for the whole server. I do need to find out when it changed and why, but for now I can confirm that what you're seeing is the case now. Hopefully there will be an update that reverts that behavior back to what it was, making it safe to make changes at the server level without the fear of AppDomain recycles. – Scott Forsyth Dec 10 '15 at 02:01