Redirect all requests to one domain to another domain. If you are doing this because you are moving content to a new domain and abandoning the old one, then for SEO purposes this redirect should be Permanent (301).

To redirect all requests to one domain to another domain, add the following rule to web.config’s <rules> section:

<system.webServer>
	<rewrite>
		<rules>
			<rule name="Redirect to new domain" stopProcessing="true">
			    <match url="(.*)" />
			    <conditions>
			        <add input="{HTTP_HOST}" pattern="example.com" />
			    </conditions>
			    <action type="Redirect" url="https://www.newexampledomain.com/{R:1}" redirectType="Permanent" appendQueryString="true" />
			</rule>
		</rules>
	</rewrite>
</system.webServer>

This would cause all requests to http(s)://(www.)example.com/ to be redirected to https://www.newexampledomain.com/.