Creating a redirect from a different domain on the correct server with web.config
<p>I have created a new site on a new domain – I have no control over the old domain, but the former host has been kind to change the DNS so it points to the correct IP.</p>

<p>As it is set up now, the old URL shows the correct content, but the URI does not change as I want it to. The unusual thing in this case is that the old url is actually a subdomain of a domain that is still in use (but which I have zero control over, so a 301 redirect from there is impractical).</p>

<p>More concretely, <a href="http://subdomain.olddomain.com/" rel="nofollow">http://subdomain.olddomain.com/</a> reaches the correct IP and shows the correct content, but from there on I want it to redirect to <a href="http://newdomain.com/" rel="nofollow">http://newdomain.com/</a></p>

<p>For now I am content with redirecting all traffic to the root of the new site, but I might do specific page redirects later on.</p>

<p>I've tried variations of this in the web.config:</p>

<pre><code>&lt;httpRedirect enabled="true" exactDestination="true" httpResponseStatus="Found"&gt;
    &lt;add wildcard="^subomain.olddomain.com" destination="http://newdomain.com/" /&gt;
&lt;/httpRedirect&gt;
</code></pre>

<p>I was hoping this would work, but unfortunately it does nothing. If I change the wildcard to something like <code>*default.htm</code>, it does redirect, so I imagine it's not completely wrong.</p>

<p>I would prefer to avoid messing with IIS etc.</p>

<p>What am I doing wrong?</p>