Reputation: 4118
I would like to share some IIS rewrite rules across environments by utilizing the web.config file thus having it part of our source control and build process.
I can write the rules fine, however, I can not work out what to do with the rest of the IIS configuration such as defaultDocument, staticContent, handlers, etc which I would like to be handled by each environment.
Is it possible to just web.config for just rewrite rules?
Upvotes: 1
Views: 136
Reputation: 2114
Yes, you can have a local web.config with just the rewrite rules. So basically you will write your rules with appropriate configuration system. In this case, IIS will pick up rest of the settings for this website or application from the applicationhost.config (global web.config) that it can find.
IIS basically adds up all the web.config files at the beginning of a worker process to make one large copy of configuration for the particular application. So for a particular application you will have its configuration come from apphost, root web.config, folder web.config and so on.
Upvotes: 1