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?

1 Answer 1


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" />
  • 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. Apr 11, 2011 at 19:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .