title: Microsoft rewriting module - Force www on URL Or remove www from URL
body: <p>I have a shared hosting plan with Windows Server 2008 and IIS7.5, and there is Microsoft rewriting module installed and enabled.</p>
  <pre><code>&lt;rewrite&gt;
      &lt;rules&gt;
          &lt;rule name=&quot;myRule&quot; patternSyntax=&quot;Wildcard&quot;&gt;
              &lt;!--Rewriting code--&gt;
          &lt;/rule&gt;
      &lt;/rules&gt;
  &lt;/rewrite&gt;
  </code></pre>
  <p>So, how to redirect <code>mydomain.example/everywhere-in-site/my-page.html</code> to <code>www.mydomain.example/everywhere-in-site/my-page.html</code> with Microsoft rewriting module?</p>
  <p>And what if I want to redirect <code>www.mydomain.example/everywhere-in-site/my-page.html</code> to <code>mydomain.example/everywhere-in-site/my-page.html</code>?</p>