Search code examples
azurehttp-status-code-404

Azure website returns 404 error after adding custom domain


I'm using the Azure Websites hosting in shared mode. After going through the process of adding a custom domain I seem to be getting a 404 when browsing to www.mydomain.example

When I browse to my site using the *.azurewebsites.example address it renders perfectly. I have also turned on all available logging and can't see the 404 errors in the web logs or any other signs of the problem.

To configure the custom domain name I followed instructions on this page, including setting up the CNAME record to awverify.mysite.example and an A record to the IP address provided in the portal.

I know there are other questions on Stack Overflow, but none of them provide an answer that fits my HTTP 404 issue. Also many of the questions on Stack Overflow seem to be out of date not that azure websites support domain names in shared mode (I believe)


Solution

  • I had only added mydomain.example in the azure portal and needed to add www.mydomain.example as well.

    I could swear that I saw some help text in the portal saying that domains should be input in that format though.