Search code examples
azurehttp-redirectdnssubdomainazure-web-app-service

Wild card sub domain redirection with Azure


I have registered my domain at Bigrock.

Say I have a domain abc.com

Requirement: Now I want to do wildcard domain redirection anything like
aaa.abc.com
bbb.abc.com
ccc.abc.com

All the above url should hit the same application which I hosted for abc.com

Process that I have done so far..
I added a A record in DNS management portal as below

    *.abc.com       111.221.95.27       Active   

Hosted my application with Azure

HOSTNAMES ASSIGNED TO SITE

www.abc.com
abc.azurewebsites.net

But it is redirecting to 404 error page if I browse anything apart from www.abc.com / abc.com


Solution

  • But it is redirecting to 404 error page if I browse anything apart from www.abc.com / abc.com

    After configured the wild card sub domain redirection, all your sub domain will point the inbound IP address of Azure website. Since Azure websites are hosted on shared platform. We have to configure all the hosted names which used to access the website on Azure Web App Custom domain panel. Please check whether abc.com and www.abc.com hostnames are configured successfully in Azure portal.

    enter image description here

    HOSTNAMES ASSIGNED TO SITE www.abc.com

    Before adding hostname, Azure Web App will verify the ownership of the hostname. For www.abc.com hostname, Please add a CNAME record pointing to yoursitename.azurewebsites.net in your custom domain provider site. For example,

    CNAME www yoursitename.azurewebsites.net
    

    enter image description here