We've got a Sitecore 9 Azure app service instance that we're having a singular issue with. We've got redirects set up as follows:

    <rule name="Redirect to www" stopProcessing="true">
    <match url="(.*)" />
        <add input="{HTTP_HOST}" pattern="xyz.com" />
    <action type="Redirect" url="https://www.xyz.com/{R:0}" />

So if I enter http://www.xyz.com, it redirects to https://www.xyz.com as expected. If I enter https://xyz.com, the domain resolves properly...the oddity is that from the first rule, I'd expect it to rewrite to https://www.xyz.com. On another site we have that's Sitecore 8 running on an Azure VM, that redirect does occur.

The catch is using http://xyz.com, this brings up the Azure 404 message suggesting a custom domain needs to be established. We did this for www.xyz.com, but not for xyz.com. I wouldn't think it would be needed since https://xyz.com is resolving, but I'm not 100% sure.

I tested the redirects locally by hacking the domain names with my hosts file, and everything worked as I'd expect. I'm not sure why there's an issue here, except to think it's something different with Azure app service. We're running it through an app gateway as well, so the IP address for xyz.com and www.xyz.com resolve to the app gateway IP, not the CD app service instance IP.

1 Answer 1


Turns out the solution was to add the naked domain xyz.com to the custom domains list. It involved pointing the A record and a TXT identifier in the DNS to Azure, so the custom domain system could detect it. Azure walks you through it pretty easily.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.