title: URL Rewrite HTTP to HTTPS but now backwards
body: <p>I have the following UrlRewrite code to change from <code>http</code> to <code>https</code> in the url but now I need it to change from <code>https</code> back to <code>http</code>. </p>
  
  <p>For example when I redirect back from the Account/Logon page to the homepage. </p>
  
  <p>Here are my rewriting rules:</p>
  
  <pre><code>&lt;rewrite&gt;
     &lt;rules&gt;
        &lt;rule name="RequiresHTTPS-Redirect" stopProcessing="true"&gt;
          &lt;match url="(.+)" /&gt;
          &lt;conditions&gt;
            &lt;add input="{HTTPS}" pattern="off" /&gt;
            &lt;add input="{RequiresHTTPS:{R:1}}" pattern="(.+)" /&gt;
          &lt;/conditions&gt;
          &lt;action type="Redirect" url="https://{HTTP_HOST}/{C:1}"
                  appendQueryString="true" redirectType="Found" /&gt;
        &lt;/rule&gt;
     &lt;/rules&gt;
     &lt;rewriteMaps&gt;
         &lt;rewriteMap name="RequiresHTTPS"&gt;
             &lt;add key="Account/LogOn" value="Account/LogOn" /&gt;
         &lt;/rewriteMap&gt;
     &lt;/rewriteMaps&gt;
  &lt;/rewrite&gt;
  </code></pre>