0

I have a config section on my web.config file for URL rewrite, like this

<system.webServer>
<rewrite>
  <rules>
    <rule name="HTTP to HTTPS redirect" stopProcessing="true">
      <match url="(.*)" />
      <conditions>
        <add input="{HTTPS}" pattern="off" ignoreCase="true" />
      </conditions>
      <action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}" />
    </rule>
  </rules>
</rewrite>
</system.webServer>

How do I use Web.config transformation to remove this section during debug?

Thanks

mhussain
  • 29
  • 5
  • Possible duplicate of [How would I remove Elmah modules from web.config using XML-Document-Transform?](https://stackoverflow.com/questions/12166618/how-would-i-remove-elmah-modules-from-web-config-using-xml-document-transform) – Lex Li Nov 17 '17 at 04:25
  • Clearly the documentation says using "Remove", https://msdn.microsoft.com/en-us/library/dd465326(v=vs.110).aspx – Lex Li Nov 17 '17 at 04:25

1 Answers1

1

Try

<system.webServer>
    <rewrite xdt:Transform="Replace"/>
</system.webServer>
spodger
  • 1,668
  • 1
  • 12
  • 16