locked
Putting Rewritte rules outside of web.config RRS feed

  • Question

  • User1153663591 posted

    Hi,

    How to move a part of Web.config to a XML file   ? Here is my code

    1    <?xml version="1.0" encoding="utf-8" ?>
    2    <!--overred-->
    3    <configuration>
    4        <configSections>
    5            <section name="RewriterConfig"type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
    6        </configSections>
    7        <RewriterConfig>
    8            <Rules>
    9                <RewriterRule>
    10                   <LookFor>~/d(\d+)\.aspx</LookFor>
    11                   <SendTo>~/default.aspx?id=$1</SendTo>
    12               </RewriterRule>
    13           </Rules>
    14       </RewriterConfig>
    15       <system.web>
    16           <httpHandlers>
    17               <add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
    18           </httpHandlers>
    19       </system.web>
    20   </configuration>

    With :

    1    <?xml version="1.0" encoding="utf-8" ?>
    2    <!--overred-->
    3    <configuration>
    4        <configSections>
    5            <section name="RewriterConfig"type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
    6        </configSections>
    7        <RewriterConfig>
    8          // Link to my XML File here
    9        </RewriterConfig>
    10       <system.web>
    11           <httpHandlers>
    12               <add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
    13           </httpHandlers>
    14       </system.web>
    15   </configuration>
    16  
     

    My XML file :
     
    1    <?xml version="1.0" encoding="utf-8" ?>
    2    <Rules>
    3                <RewriterRule>
    4                    <LookFor>~/d(\d+)\.aspx</LookFor>
    5                    <SendTo>~/default.aspx?id=$1</SendTo>
    6                </RewriterRule>
    7    </Rules>
    8    
    
     
     
    

     

    Friday, August 3, 2007 5:10 AM

All replies