title: Rewrite Rule https://www to https:// IIS7
body: <p>I’ve received my ssl certificate on a shared hosting provided and installed it successfully. The certificate is prepared for mysite.com, not for *.mysite.com.
  I want the site to be accessible like https : // mysite.com – no www, no http (only secure connections). I've found similar questions here, but not the right one.
  I'm using IIS 7, .net environment. The following rules were added my web.config:</p>
  
  <pre><code>&lt;rule name="Remove WWW prefix"&gt;
  &lt;match url="(.*)" ignoreCase="true" /&gt;
  &lt;conditions&gt;
      &lt;add input="{HTTP_HOST}" pattern="^www\.mysite\.com" /&gt;
  &lt;/conditions&gt;
  &lt;action type="Redirect" url="https://mysite.com/{R:1}" redirectType="Permanent" /&gt;
  &lt;/rule&gt;
  
  &lt;rule name="Redirect to HTTPS"&gt;
  &lt;match url="(.*)" /&gt;
  &lt;conditions&gt;
      &lt;add input="{SERVER_PORT}" pattern="443" negate="true" /&gt;
  &lt;/conditions&gt;
  &lt;action type="Redirect" url="https:// mysite.com/{R:1}" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>Everything is working fine, but the url <a href="https://www.mysite.com" rel="nofollow">https://www.mysite.com</a> is not redirected to <a href="https://mysite.com" rel="nofollow">https://mysite.com</a>. I get the error that the certificate is for mysite.com (which was intended :), the message comes from firefox) with the advice to add exception. </p>
  
  <p>My question is what is the appropriate rule for this url? </p>
  
  <p>Thank you in advance for your time.</p>