title: Url rewrite not working for ajax request to wcf service from http to https
body: <pre><code>var strBaseUrl = "http://service.mydomain.com/MyserviceHost/stage/";
      function Login() {
          debugger;
          var LoginInfo = JSON.stringify({ "strAccountName": "#####", "strPassword": "######", "strDeviceId": "################" });
          var strUriGet = strBaseUrl + "OneviewClient.svc/Login";
  
          $.ajax({
              type: "POST",
              url: strUriGet,
              data: LoginInfo,
              contentType: "application/json; charset=utf-8",
              dataType: "json",
              async: false,
              processData: true,
              success: function (data, status, jqXHR) {
                  debugger;
                  //alert("success..." + data);
                  console.log("success..." + jqXHR.responseText);
                  $("#labelToken").text(data.loginResponse.strToken);
              },
              error: function (xhr, status, exception) {
                  debugger;
                  console.log(xhr.responseJSON);
                  console.log(xhr.responseText);
              }
          });
      }
  </code></pre>
  
  <p>Above ajax call is made with <a href="http://service.mydomain.com/MyserviceHost/stage/" rel="nofollow">http://service.mydomain.com/MyserviceHost/stage/</a> 
  i have written rewrite module wcf service web.config to rewrite all http reuqest to https.
  When i am trying to call http link in browser address its simply redirect to https, but in ajax call it wont (it throws network error), is there any things which i missed?</p>
  
  <pre><code>&lt;rewrite&gt;
    &lt;rules&gt;
      &lt;rule name="HTTP to HTTPS redirect" stopProcessing="true"&gt;
        &lt;match url="(.*)" /&gt;
        &lt;conditions&gt;
          &lt;add input="{HTTPS}" matchType="Pattern" pattern="off" ignoreCase="true" negate="false" /&gt;
        &lt;/conditions&gt;
        &lt;action type="Redirect" url="https://{HTTP_HOST}/MyserviceHost/stage/{R:1}" redirectType="SeeOther" /&gt;
      &lt;/rule&gt;
    &lt;/rules&gt;
  &lt;/rewrite&gt;
  </code></pre>