Deploying to IIS removes URL rewrite rules?

I configured two publish profiles to deploy the website to IIS.

First one is based on FTP and second one is based on MS Web Deploy.

Both deploy methods removes URL Rewrite rules, however, this is not what I intended.

How should I configure IIS, publish profile or Web.config to prevent removing my rules?


Solution: I had to add:

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

My web.config file. Somehow web.config from my project overwrites iss rules