Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,177 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I'm using an app service, and if I have a domain called test.com, I want to know how to redirect to test.com when I connect to www.test.com
To rewrite a URL, you need to create a web.config file in your wwwroot folder and put the necessary entries in there, if you don't already have a web.config file for your site.
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect rquests to default azure websites domain" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^yoursite\.azurewebsites\.net$" />
</conditions>
<action type="Redirect" url="http://www.yoursite.com/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Source: https://www.zainrizvi.io/blog/block-default-azure-websites-domain/