0

When I configure a rewrite rule in IIS, it appears in the folder in a file called web.config.

When I publish a website to the folder using MSDeploy, the file is deleted.

Is it possible to have IIS store the file somewhere else?

Ian Warburton
  • 15,170
  • 23
  • 107
  • 189
  • Maybe you can just include the generated webconfig in your web project and mark it as build action=none and copy always? It should then copy the file when you are using the msdeploy. – Bobo Nov 21 '18 at 14:54
  • I suppose so but then my app’s source code is tied to IIS. – Ian Warburton Nov 21 '18 at 15:15
  • 1
    if you do not want to have web.config rules in folder, you can use https://serverfault.com/questions/567191/cant-find-iis-rewrite-rule-in-config-xml the 'Server level' option. If you are not the only citizen on IIS, use with care. – Bobo Nov 21 '18 at 15:24
  • Doesn't seem to work at server level when there's an app/virtual directory in between. So I will save the file to the project and count myself lucky it works at all. – Ian Warburton Nov 21 '18 at 15:56
  • Possible duplicate of [IIS7 urlrewrite module - Rules in external xml file](https://stackoverflow.com/questions/3767864/iis7-urlrewrite-module-rules-in-external-xml-file) – Jeroen Nov 21 '18 at 17:38

0 Answers0