title: Re-write old url to new url Asp.Net
body: <p>I have 2 domains pointing to the same Umbraco application:</p>
  
  <pre><code>oldexample.com
  newexample.com
  </code></pre>
  
  <p>I want my application to change the URL from:</p>
  
  <pre><code>oldexample.com/... 
  TO 
  newexample.com/... 
  </code></pre>
  
  <p>when people visit the oldexample.com.</p>
  
  <p>In my web.config, I've placed this, but to no effect:</p>
  
  <pre><code>&lt;rewrite&gt;
      &lt;rules&gt;
          &lt;rule name="Redirect old-domain to new-domain" stopProcessing="true"&gt;
              &lt;match url=".*" /&gt;
              &lt;conditions&gt;
                  &lt;add input="{HTTP_HOST}" pattern="^oldexample.com$" /&gt;
              &lt;/conditions&gt;
              &lt;action type="Redirect" url="http://www.newexample.com/{R:0}" appendQueryString="true" redirectType="Permanent" /&gt;
          &lt;/rule&gt;
          &lt;rule name="WWW Rewrite" enabled="true"&gt;
              &lt;match url="(.*)" /&gt;
              &lt;conditions&gt;
                  &lt;add input="{HTTP_HOST}" negate="true" pattern="^www\." /&gt;
                  &lt;add input="{HTTP_HOST}" negate="true" pattern="localhost" /&gt;
              &lt;/conditions&gt;
              &lt;action type="Redirect" url="http://www.{HTTP_HOST}/{R:0}" appendQueryString="true" redirectType="Permanent" /&gt;
          &lt;/rule&gt;
      &lt;/rules&gt;
  &lt;/rewrite&gt;
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p><em>// The application is hosted in Azure web sites.</em> And both URLs are hostnames assigned to the site.</p>