Hello Christoph Reckers,
You can use Azure Front Door to redirect a URL based on path. Refer this MSDOC to configure Redirect URL using Front Door.
- Create an Azure Front Door (classic/Premium).
- Configure the Front Door to redirect traffic from
www.mydomain.com
towww.mydomain.de
. - Create a CNAME record for
www.mydomain.com
and point it to the Front Door endpoint. - Navigate to
Azure Front Door=>Settings=>Rule Sets
, click add. set up a redirect rule to forward requests fromwww.mydomain.com
towww.mydomain.de
.
If it is single redirect, you can use an Azure App Service with a redirect rule.
- In App Service => Custom domains => Add custom domain=> add your domain
www.mydomain.com
and validate. It will show a prompt to verify domain ownership via DNS (CNAME or TXT record in DNS settings).
Navigate to KUDU site of web app https://appname.azurewebsites.net/
=>Debug Console=>CMD=>Site/wwwroot => Create a web.config
file to issue a 301 Permanent Redirect
to www.mydomain.de
.
Add below configuration in web.config:
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Rewrite to domain.de">
<match url="^(.*)$" />
<action type="Redirect" url="https://www.mydomain.de" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
This redirects the requests of www.mydomain.com
to www.mydomain.de
Hope this helps.
Please do not forget to click "Accept the answer” and Yes wherever the information provided helps you, this can be beneficial to other community members.
If you have any other questions or still running into more issues, let me know in the "comments" and I would be happy to help you.