@Buddiz AI You may want to know that since Traffic Manager only supports custom domain mapping with CNAME records, and because DNS standards don't support CNAME records for mapping root domains (for example, contoso.com), Traffic Manager doesn't support mapping to root domains.
To work around this issue, use a URL redirect from at the app level. In ASP.NET Core, for example, you can use URL Rewriting. Then, use Traffic Manager to load balance the subdomain (www.contoso.com).
To permit the app to redirect non-www
requests to www
:
- AddRedirectToWwwPermanent: Permanently redirect the request to the
www
subdomain if the request is non-www
. Redirects with a Status308PermanentRedirect status code. - AddRedirectToWww: Redirect the request to the
www
subdomain if the incoming request is non-www
. Redirects with a Status307TemporaryRedirect status code. An overload permits providing the status code for the response. Use a field of the StatusCodes class for a status code assignment.
Refer to this doc link for details- https://learn.microsoft.com/en-us/aspnet/core/fundamentals/url-rewriting?view=aspnetcore-8.0
Let us know.