Separate config file for sections of web.config

You can certainly move your rewrite rules and mappings out to a separate file:

Storing URL rewrite mappings in a separate file

<system.webServer>
  <rewrite>
    <rewriteMaps configSource="rewritemaps.config" />
    <rules configSource="rewriteRules.config" />
  </rewrite>
</system.webServer>

In addition you can move quite a few configuration sections to their own files:

<appSettings configSource="appSettings.config" /> [Docs]

<connectionStrings configSource="connectionStrings.config"/> [Docs]

<pages configSource="pages.config"/> [Docs]

For more info see this page which will help you decide if a configuration section can be stored externally:

General Attributes Inherited by Section Elements

Leave a Comment