locked
multiple rules.config files in web.config RRS feed

  • Question

  • I have an enormous set of rules that need to be better managed in my web.config. I have already pulled them to their own .config but that is not enough

     <rewrite>
          <rules configSource="RewriteRules.config"/>
        </rewrite>

    I really need to split these files logically to their own sections like:

    newsRules.config
    forumRules.config
    legacyRules.config

    Is there a way I can chain these together or create separate sections?

    I am looking at this but it doesn't really address this issue
    http://www.iis.net/learn/extensions/url-rewrite-module/using-custom-rewrite-providers-with-url-rewrite-module

    I have also tried something like this but it also won't work

     ...<configSections>
        <sectionGroup name="rewriteRules">
          <section name="News" type="FileContainsProvider,Microsoft.Web.Iis.Rewrite.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        </sectionGroup>...
    
    
    
    ...<rewriteRules>
        <News>
          <rewrite>
            <rule name="xxx" stopProcessing="true">
              <match url="^mytest" />
              <action type="Redirect" url="http://cnn.com" appendQueryString="false" />
            </rule>
          </rewrite>
        </News>
      </rewriteRules>
    </configuration>

    Any tips would be appreciated. Please note I am well aware of the configSource param. This won't work however as you can only call one file. 

    thanks

    Mac


    mac

    • Moved by Ego Jiang Thursday, May 30, 2013 8:28 AM
    Wednesday, May 29, 2013 4:41 PM

Answers

All replies