title: Second trailing slash in redirected URL
body: <p>I am using URL Rewrite to force a http to https redirect. It is working, except it is adding a second trailing slash to the URL. So for example, if I go to <a href="http://example.com" rel="nofollow noreferrer">http://example.com</a>, the rewritten URL ends up being <a href="https://example.com//" rel="nofollow noreferrer">https://example.com//</a>. I don't want even 1 trailing slash, let alone 2 and I cannot get rid of it. I tried <a href="https://stackoverflow.com/questions/14816776/iis-forces-slash-even-with-url-rewrite-to-remove-it">this</a> solution but it didn't work. Might be because the person wanted to get rid of the trailing slash, and I have 2 of them so it isn't matching?</p>
  <p>I have the below rules in my web.config file. I am running Windows Server 2019 with IIS 10 and the URL Rewrite Module. If someone can show me where I am going wrong, I'd appreciate it!</p>
  <pre><code>&lt;rule name=&quot;HTTPS Redirect&quot; stopProcessing=&quot;true&quot;&gt;
      &lt;match url=&quot;(.*)&quot; /&gt;
          &lt;conditions&gt;
              &lt;add input=&quot;{HTTPS}&quot; pattern=&quot;^OFF$&quot; /&gt;
          &lt;/conditions&gt;
      &lt;action type=&quot;Redirect&quot; url=&quot;https://{HTTP_HOST}/{REQUEST_URI}&quot; appendQueryString=&quot;false&quot; /&gt;
  &lt;/rule&gt;
  &lt;rule name=&quot;SEO - Remove trailing slash&quot; stopProcessing=&quot;false&quot;&gt;
      &lt;match url=&quot;(.+)/$&quot; /&gt;
          &lt;conditions logicalGrouping=&quot;MatchAll&quot; trackAllCaptures=&quot;false&quot;&gt;
              &lt;add input=&quot;{HTTP_METHOD}&quot; pattern=&quot;GET&quot; /&gt;
              &lt;add input=&quot;{REQUEST_FILENAME}&quot; matchType=&quot;IsDirectory&quot; negate=&quot;true&quot; /&gt;
              &lt;add input=&quot;{REQUEST_FILENAME}&quot; matchType=&quot;IsFile&quot; negate=&quot;true&quot; /&gt;
          &lt;/conditions&gt;
      &lt;action type=&quot;Rewrite&quot; url=&quot;_{R:1}&quot; /&gt;
  &lt;/rule&gt;
  </code></pre>