Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to export URL rewrite rules for IIS7?

I am setting up a duplicate of a website for internal use (testing) and want to duplicate all of the URL Rewrite rules without having to manually enter them.

There is an import option, but no obvious 'export'...


share|improve this question
up vote 13 down vote accepted

I think you have 2 options:

You could look in the web.config file, and copy the <rewrite> section, then paste into the web.config file on the new system.

Or, you could use appcmd to export the rules to a file, and to import them on the new system:


appcmd list config "websitename/appname" -section:system.webServer/rewrite/rules -xml > rewriterules.xml


appcmd set config -in < rewriterules.xml

You can also export any global rewrite rules using:

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

The import command would be the same.

share|improve this answer
Cheers! I'm so used to working with Apache that I forgot about the web.config! Thanks again! – Matt Feb 16 '10 at 21:02
for info on using appcmd check out here:… – brendan Nov 2 '10 at 14:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.