Ian Vink
Ian Vink

Reputation: 68750

Visual Studio Web.Config Transform

We have our web.configs transformed nicely.

However, to one of them only, we need to add all of this to the web.config.

Not sure how to add a whole XML node.

system.webServer
<rewrite>
  <rules>
    <rule name="Redirect To HTTPS" enabled="true" stopProcessing="true">
      <match url="(.*)" />
      <conditions logicalGrouping="MatchAll">
        <add input="{HTTPS}" pattern="^OFF$" />
      </conditions>
      <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" />
    </rule>
  </rules>
</rewrite>

Upvotes: 0

Views: 69

Answers (1)

krisdyson
krisdyson

Reputation: 3255

Use xdt:Transform="Insert" on the <rewrite> node inside the target transform config file

Upvotes: 0

Related Questions