Previous Next

Thread: Maximum number of rewrite rules

Last post 07-24-2008 4:21 PM by ruslany. 5 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (6 items)

Sort Posts:

  • 07-23-2008, 10:15 AM

    • dgrose
    • Not Ranked
    • Joined on 07-17-2008, 1:42 PM
    • Birmingham, UK
    • Posts 6

    Maximum number of rewrite rules

     Hi,

    What is the maximum number of rules you can set up in the globalmodules?

    I have around 10,000 pages that need to have a permanant redirect, unfourtunately they are uniqe pages.

    Thanks

    Dave

  • 07-23-2008, 12:35 PM In reply to

    • ruslany
    • Top 25 Contributor
    • Joined on 07-01-2007, 7:38 PM
    • Redmond, WA
    • Posts 202

    Re: Maximum number of rewrite rules

    If you have so many permanent redirects and they are all unique pages, then you should consider using rewrite maps, instead of creating 10,000 rewrite rules.

    To learn more about rewrite maps in URL rewrite module check out these links:

    http://learn.iis.net/page.aspx/469/using-rewrite-maps-in-url-rewrite-module/

    http://ruslany.net/2008/07/iisnet-uses-url-rewrite-module/

     

    http://ruslany.net
  • 07-24-2008, 5:17 AM In reply to

    • dgrose
    • Not Ranked
    • Joined on 07-17-2008, 1:42 PM
    • Birmingham, UK
    • Posts 6

    Re: Maximum number of rewrite rules

     Thanks Ruslan,

    I set them up in the applicationHost.config file and it works great.

    FYI, when I put them in the web.config file, I got an error message complaining the web.config file was too big (it was just over 2MB in size).

    Regards

    Dave

  • 07-24-2008, 11:02 AM In reply to

    • ksingla
    • Top 10 Contributor
    • Joined on 06-13-2006, 11:02 PM
    • Redmond, WA
    • Posts 561

    Re: Maximum number of rewrite rules

    Max size of web.config allowed is 250KB by default. You can change regkey HKLM\SOFTWARE\Microsoft\InetStp\Configuration\MaxWebConfigFileSizeInKB to allow bigger web.config if needed. Read more here.

    -Kanwal-

  • 07-24-2008, 11:06 AM In reply to

    • Rovastar
    • Top 10 Contributor
    • Joined on 03-13-2008, 2:00 PM
    • London, UK
    • Posts 758

    Re: Maximum number of rewrite rules

    dgrose:

     Thanks Ruslan,

    I set them up in the applicationHost.config file and it works great.

    FYI, when I put them in the web.config file, I got an error message complaining the web.config file was too big (it was just over 2MB in size).

    Regards

    Dave

     

    Seriously if you web.config is that big I would look at some other way of solving your problem. 

    Most overused word in IT is 'should' as in 'That should work!?!'
  • 07-24-2008, 4:21 PM In reply to

    • ruslany
    • Top 25 Contributor
    • Joined on 07-01-2007, 7:38 PM
    • Redmond, WA
    • Posts 202

    Re: Maximum number of rewrite rules

    As an alternative to putting huge rewrite map into applicationHost.config you can put it into a separate config file and then reference that config file from your web.config:

    For example, create a file named rewritemaps.config and put this inside of it:

    <rewriteMaps>
     <rewriteMap name="TestMap" >
      <add key="foo" value="bar" />
      <add key="goo" value="dada" />
     </rewriteMap>
    </rewriteMaps>

    Then in your web.config reference this file:

    <rewriteMaps configSource="rewritemaps.config" />

    http://ruslany.net
Page 1 of 1 (6 items)
Page view counter