What is Cloudflare?
Cloudflare is loved by millions of websites to decrease the web page load time and protect from online threats, including DDoS.
If you heard Cloudflare for the first time, then here is a one-liner.
Cloudflare is a CDN (Content Delivery Network), and the Security Company helps small to enterprise business to supercharge and secure the online assets.
The purpose of this tutorial is to transfer your domain's DNS management to Cloudflare will give you the following benefits:
Performance
Faster performance is the benefit most people think of when considering Cloudflare, and for good reason. Websites that start using Cloudflare have seen 50% reductions in load times, or even more in some cases. Cloudflare speeds up content delivery by:Decreasing the distance between where content is stored and where it needs to go
Reducing file sizes to increase load speed
Optimizing server infrastructure to respond to user requests more quickly
Reliability
Sometimes, things go wrong on the Internet. Servers go down, networks become congested, and connections get interrupted. Cloudflare enables web applications to provide uninterrupted service to users even in the face of these problems.Cloudflare balances the load of network traffic, ensuring no one server gets overwhelmed. In the event that a single server stops working, Cloudflare can initiate a "failover" process that allows a backup server to take over. Cloudflare can also route around network congestion, like GPS navigation software finding a way around heavy freeway traffic.
Since Cloudflare has multiple servers spread out in many different data centers, they can also offer a great deal of redundancy. If a server, a data center, or an entire region of data centers goes down, Cloudflare can still deliver content from other servers in the network.
Resilience against attack
Cloudflare is especially well-suited to defending websites from denial-of-service (DoS) and distributed denial-of-service (DDoS) attacks. In these attacks, an attacker directs vast quantities of junk network traffic at a website to try to overwhelm and crash the website. With their many servers, CDNs are better able to absorb large amounts of traffic, even unnatural traffic spikes from a DDoS attack, than a single origin server. By doing so, they keep websites online even when under attack.
Better Domain Forwarding
Page Rules is a powerful new set of tools that allows you to control how Cloudflare works on your site on a page-by-page basis. The feature provides many of the most popular controls of HTACCESS with a user-friendly interface.
In this tutorial, we'll learn how to:
Change the nameservers from GoDaddy to Cloudflare
Connect your root domain in Cloudflare
Add your Custom Domain in Art Storefronts.
This means you will be adding the www version of your domain to Art Storefronts(i.e. www.domain.com).
What you will need:
Content
Step 1: Add your domain in Cloudflare
Log into your Cloudflare account. We'll do this by entering the login email and password as provided when you were registering your Cloudflare account. if you haven't created an account yet, please click here for a free Sign Up
Add your site by clicking ‘Add Site’.
On the next page please add your domain name (example.com) and click on Add Site. For this tutorial, we'll be using artmarketsolution.com as an example.
Select your preferred plan
In the next step, you'll be taken to a new screen where Cloudflare will ask you to review your DNS Records. Once done, please click on Continue.
Cloudflare will then give you the new nameservers to change in your domain provider. In this case, it will be GoDaddy.
What Next?
Change Nameservers in Go Daddy
Step 2: Changing your domain nameservers to Cloudflare
Changing the nameservers from GoDaddy to Cloudflare will ensure that the management of your DNS records will be managed by Cloudflare rather than being managed by GoDaddy
Please Note: This will just transfer the DNS management to Cloudflare but your domain registrar will still be GoDaddy. All renewals and additional hosting resources will still be available in GoDaddy
Log in to the administrator account for GoDaddy domain registrar
After logging in, please navigate to your domains section and choose the DNS Records of your chosen domain
Change your DNS Records (NAMESERVERS) to what your Cloudflare account recommended.
Scroll down on the DNS page until you find Nameservers and click on Change.
GoDaddy will let you know that the procedure is tricky. Please click on Enter My Own Nameservers.
Please enter the nameservers provided by Cloud-flare and click on Save.
Confirm the changes
The next step is to confirm the nameserver with Cloudflare. Go back to your Cloudflare account and mark that you are Done with changing the nameservers values.
After Cloudflare is done checking your new nameservers, you can now go ahead and start setting up your custom domain so that it shows your Art Storefronts website.
Step 3: Adding Your Domain CNAME Record for ASF
After transferring the DNS management to Cloudflare, the next step will ensure that your domain is pointed to Art Storefronts where you have your website.
From within your Cloudflare account, navigate to your DNS setting
Change the value of the www CNAME Record to www.artstorefronts.com
Make sure that www is marked as the name
Enter www.artstorefronts.com as the target
Select Automatic TTL
The cloud should be orange with a grey arrow through it
Add a Root Domain CName Record
On the same page (DNS), click on Add Record.
Select CNAME from the dropdown menu
Enter @ as the name
Enter www.artstorefronts.com as the target
Select Automatic TTL
The cloud should be orange with a grey arrow through it
Click Save
Step 4: Adding Your Page Redirect Rule
This step will ensure that all links related to your domain work seamlessly. This means your domain will work with or without https and it having www in your address will work. For example; if we use a domain with the name domain.com, Adding a Page Rule in Cloudflare will ensure that the links below work without any errors:
Let's set this up:
In the next step, we are going to add your Page Redirect Rule. You can do this by going back at the side navigation, click Rules
If you don’t already have one, create a new page rule
Enter your domain as yourdomain.com/*. In our case, we are going to enter artmarketsolution.com/*.
Note: in place of your domain you see here you will enter your actual domain
Right below that in the settings, please select the Forwarding URL.
This will load some settings for you to adjust.
Under Select Status Code click 301 - Permanent Redirect
For the destination URL, enter in this exact format https://www.yourdomain.com/$1. In our case, we’ll add https://www.artmarketsolution.com/$1
Note: in place of ‘yourdomain’ enter your actual domain
Click Save and Deploy
Since both Art Storefronts and Cloud-flare automatically add SSL Certificates to your domain, we need to ensure that both of these platforms can integrate with one another with no conflicts. We can do this by going back at the side navigation and click SSL/TLS
You’ll be taken to a new page where you’ll be provided some options on how to manage your SSL. Please change the setting from Full to Flexible.
Please Note: If you do not check this step, your domain will result in an error. Below is an example:
Step 5: Adding Your Domain in Art Storefronts
Now it’s time to switch to the Site Manager in Art Storefronts in order to perform the other part of this process. Once your site has loaded, click on Site Address.
Click on + Add New.
Enter your domain name into this field. If it’s not a subdomain, you should have a www at the start of it, then click on Create.
You should now have your domain name as shown below.
Please note: Although your domain name may be up and running very quickly, in some cases it may take up to 24-48 hours for these settings to take effect properly. While these changes are propagating you may experience errors while trying to access your domain name, but these should disappear once this process has been completed.