A complete walk-through of domain setup
Back to Dashboard
Since setting up a domain name correctly is a critical for creating your Newsy site, we want to take an example domain and walk you through setting it up correctly.
Objectives
We are going to take a domain name flyn.app and create a Newsy site. We want the users to visit Newsy site via https://www.flyn.app. We also want the root domain flyn.app to be redirected to https://www.flyn.app. In addition, any non-HTTPS requests http://flyn.app and http://www.flyn.app should also be redirected to https://www.flyn.app.
For this, we will be using the DNS server available from Cloudflare. There are many DNS services available and most likely your domain registrar also provides DNS services. However, we recommend Cloudflare because of its many features and the fact that they are offered for free.
Please ignore the Cloudflare Integration section in the screenshot above. This is discussed in our Cloudflare Integration documentation.
1. Add your domain on Cloudflare
First, go to your Cloudflare account and add a new domain as shown below. When asked for the pricing plan, select Free plan, which is sufficient for this use.
Cloudflare will retrieve current DNS settings for the domain and will display them in the next screen as shown below.
The above DNS setting is what the current domain registrar has specified by default for flyn.app. We actually need DNS setting for Newsy site, so we will delete all of the above and enter what we need.
First, we need to add the CNAME for www.flyn.app, which is what we added in Newsy as shown below.
This entry will allow us to access our production via http://www.flyn.app. Next, we want to add an entry to make sure when a user types in the root domain flyn.app, they are redirected to http://www.flyn.app.
There are several ways to do this. We could add another CNAME entry for the root domain where the name is given as *. However, since not all DNS servers provide root-level CNAME, we are going to take an advantage of a redirect service provided by GitHub (also free). First, we create an A Record which points to an IP address 45.55.72.95 as shown below.
Next, we add a TXT record where the name value is _redirect and the content value is Redirects to https://www.flyn.app as shown below.
Please note that we set the content value of this redirect as Redirects to https://www.flyn.app because that's the final destination we want all requests to be redirected to. If you do not want to enable HTTPS, then simply the value would be Redirects to http://www.flyn.app.
Once you click next, you will be prompted to change the name servers of your domain to Cloudflare name servers as shown below.
2. Enabling HTTPS
To enable HTTPS, click on the SSL/TLS option at the top and make sure that FULL option is selected as shown below. Also, if you see a prompt that says Always turn on HTTPS, set it to Yes if you're enabling HTTPS for your site.
3. Adding page rules
Finally, we want to make sure that all other requests such as http://www.flyn.app, http://flyn.app and https://flyn.app are redirected to https://www.flyn.app. For this, we make use of Cloudflare's Page Rules. Click on the Page Rules menu at the top and click on Create page rule.
As a first rule, we specify that when a user types in http://flyn.app, they are redirected to https://www.flyn.app as shown in the below screen. Make sure you note the http://flyn.app/* and https://www.flyn.app/$1 when you type in the values.
Create two more rules. One for http://www.flyn.app and another for https://flyn.app. Your final set of page rules should be as follows.
4. Test
That should be all for your Newsy site to work correctly. We do recommend accessing your site through one single domain (in this case https://www.flyn.app). It makes it easier for the search engine to index the contents and also generating and sharing URLs are all centralized.
Got questions?
Get in touch with us