Root/Naked Domains (Cloudflare)

We use Azure App Services to host sites rather than managed servers as this provides many benefits like load balancing, auto scaling etc. Because of this TProfile doesn’t have access to server level management apps like IIS on Windows to create URL redirects etc. these all need to be handled at the DNS level.

Your site is hosted and available by pointing CNAME records to http://tprofile-app.trafficmanager.net we then add the domain our side internally and configure SSL certificates for it.

This doesn't normally present any problem until you also have a frontend website with us and wish to use a naked domain (no www) to either serve or redirect to your main domain (normally the www version). For example using the tprofile.com domain you will almost certainly require https://tprofile.com to forward requests to https://www.tprofile.com (or vice versa).

To achieve this you need a DNS provider that supports ALIAS records at the root (also referred to as CNAME flattening by some providers). We would recommend using Cloudflare to achieve this, below is a guide on setting this up. At the time of writing this you can achieve this for no cost in Cloudflare.

Remember if you are making URL changes to notify TProfile of your URL’s as these also needs adding once configured our side.

Cloudflare Setup

  1. Create a Cloudflare account

  2. Add your domain under Websites. If you’re using a new domain it will be a case of simply changing the nameservers on your current domain name provider. If it’s an existing site Cloudflare offers a useful migration tool to bring in all your existing DNS entries before changing the nameservers to theirs.

  3. Once you have this you can then add/update two DNS records for naked and www domains.

     

  4. Now for handling the redirect go to Rules > Page Rules and select Create Page Rule, the example below redirects the naked domain to the www version but you can easily change this to work in the opposite manner