我注意到,当我通过msdeploy部署我的应用程序时,所有的URL重写(IIS 7.5)都被删除。 我怎样才能防止这种情况发生,或者我怎样才能将url重写成msdeploy脚本的一部分?
好吧,我只是没有想到。 我实际上不必对MSDeploy做任何事情。 我在IISpipe理器中创build的设置直接转储到我的应用程序根目录web.config中。 部署新的configuration文件总是会覆盖我在IIS中设置的内容。 解决的办法是把redirect到web.config并部署。
例如:
<system.webServer> <rewrite> <rules> <rule name="weddings1" stopProcessing="true"> <match url="weddings.html" /> <action type="Redirect" url="weddings" /> </rule> </rules> </rewrite> </system.webServer>