« Previous Next »

Thread: import / export rules

Last post 10-03-2008 12:30 PM by ruslany. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 10-03-2008, 9:45 AM

    • mike123
    • Top 500 Contributor
    • Joined on 07-22-2002, 3:45 PM
    • Posts 19

    import / export rules

    Hi, I'm wondering if theres a way to easily import and export rules across servers ?

    I just setup a dozen rules, and now have to do the same rules on another server.   I created the rules in the IIS GUI.  Any tips appreciated!

    Thanks!

    Mike123

  • 10-03-2008, 12:29 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 2,343

    Re: import / export rules

    You can export the rules using appcmd, eg

    appcmd list config -section:system.webServer/rewrite/globalRules -xml > file.xml

    or

    appcmd list config "My Site/My App" -section:system.webServer/rewrite/rules -xml > file.xml

    and you can then import them using appcmd like below

    appcmd set config -in < file.xml

     

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 10-03-2008, 12:30 PM In reply to

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

    Re: import / export rules

    In majority of the cases the rewrite rules are stored in web.config file in section <rewrite>. You can just copy this file (or just <rewrite> section) to another server and those rule will apply there as long as URL rewrite module is installed there.

    http://ruslany.net
Page 1 of 1 (3 items)
Microsoft Communities