Default web.config file
<configuration>
<system.webServer>
<rewrite>
<rules>
</rules>
</rewrite>
</system.webServer>
</configuration>
Add this between <rules> and</rules>
<rule name=”domain_redirect” stopProcessing=”true”>
<match url=”(.*)” />
<conditions>
<add input=”{HTTP_HOST}” pattern=”^www\.olddomain\.de$” />
</conditions>
<action type=”Redirect” url=”https://www.newdomain.de/{R:1}” redirectType=”Permanent” />
</rule>
Replace olddomain and newdomain with your value and maybe change the www value to your subdomain.