Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer

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:

<system.webServer>
    <rewrite>
        <rules>
            <rule name="weddings1" stopProcessing="true">
                <match url="weddings.html" />
                <action type="Redirect" url="weddings" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>
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
add comment

Your Answer

 
discard

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.