title: Replacing double slashes on azure
body: <p>Is there any way to rewrite url in order to replace the double slashes (//) of the URL in IIS 8.0 on azure. The following two solutions below work in my local iis (Microsoft-IIS / 8.0), the two servers are IIS 8.0 running on azure locally have not tried a thousand ways and nothing works, thanks in advance.</p>
  
  <p>solution 1 work locally, doesn't work on azure</p>
  
  <pre><code> protected void Application_BeginRequest(object sender, EventArgs e)
  {
      string requestUrl = Request.ServerVariables["REQUEST_URI"];
      string rewriteUrl = Request.ServerVariables["UNENCODED_URL"];
      if (rewriteUrl.Contains("//") &amp;&amp; !requestUrl.Contains("//"))
          Response.RedirectPermanent(requestUrl);
  }
  </code></pre>
  
  <p>solution 2 the same results work locally, doesn't work on azure </p>
  
  <pre><code>&lt;rewrite&gt;
    &lt;rules&gt;
      &lt;rule name="Remove multiple slashes" stopProcessing="true"&gt;
        &lt;match url=".*" /&gt;
        &lt;action type="Redirect" url="{REQUEST_URI}" /&gt;
        &lt;conditions&gt;
          &lt;add input="{HTTP_X_REWRITE_URL}" pattern="([^/]*)/{2,}([^/]*)" /&gt;
        &lt;/conditions&gt;
      &lt;/rule&gt;
    &lt;/rules&gt;
  &lt;/rewrite&gt;
  </code></pre>