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

I've noticed that when I deploy my application via msdeploy all of the url re-writes (IIS 7.5) are removed. How can I prevent this from happending or how can I build the url re-write into part of the msdeploy script?

share|improve this question

Ok, I just wasn't thinking straight. I don't actually have to do anything with MSDeploy. The settings that I create in the IIS manager are simply dumped straight into my applications root web.config. Deploying the new config files always overwrites what I'd set in IIS. The solution is to put the redirects into the web.config and deploy that.

For example:

            <rule name="weddings1" stopProcessing="true">
                <match url="weddings.html" />
                <action type="Redirect" url="weddings" />
share|improve this answer
You're right. IIS7's distributed configuration model is great in many ways, but has the gotcha of this situation. As you suggested, adding to source control will take care of it. You can set the rule in your applicationHost.config file too if you want, but you need to do it manually since IIS Manager will default to placing it in the site's web.config file. – Scott Forsyth - MVP Apr 11 '11 at 19:39

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.