Link a Domain Hosted on Cloudflare

Supported System: e-Commerce, Social Commerce

Before you begin, please note: This feature is supported in the yearly plan only.

If your domain is hosted on Cloudflare, please follow the steps in this article to add CNAME records and create a 301 redirect rule in Cloudflare, so customers can access your store via your domain.

In this article, you'll find:

 

Step 1. Log in to Cloudflare

Go to Cloudflare Homepage and log in.

Log in button at the top right of the Cloudflare homepage

 

Step 2. Select "DNS"

Go to [DNS] and click Add record.

Add record button on the Cloudflare DNS page

 

Step 3. Add CNAME records

i. Subdomain

Set the Proxy status to "DNS Only". SHOPLINE will then issue the SSL certificate for you and apply DDoS protection.

Name subdomain
Type CNAME
Target Your complete custom domain.cname.shoplineapp.com
Proxy status DNS only Gray cloud icon showing the Cloudflare proxy status is DNS only

 

Example

*Note: This is an example. Please enter your actual domain information when setting up.

For example, if the domain name is "www.shopline.tw", the CNAME record will be as follows:

Name www
Type CNAME
Target www.shopline.tw.cname.shoplineapp.com
Proxy status DNS only Gray cloud icon showing the Cloudflare proxy status is DNS only

Example of adding a subdomain CNAME record in Cloudflare

 

ii. Root domain

Name root domain
Type CNAME
Target subdomain
Proxy status Proxied Orange cloud icon showing the Cloudflare proxy status is Proxied

Note: You must set this in advance for the 301 redirect below to take effect.

 

Example

*Note: This is an example. Please enter your actual domain information when setting up.

For example, if the domain name is "www.shopline.tw", the CNAME record will be as follows:

Name @
Type CNAME
Target www.shopline.tw
Proxy status Proxied Orange cloud icon showing the Cloudflare proxy status is Proxied

Example of adding a root domain CNAME record in Cloudflare

 

Step 4. Create a new page rule

Select [Rules] > [Page Rules] and click Create Page Rule.

Page Rules page under the Cloudflare Rules menu with the Create Page Rule button

 

The settings will be:

URL root domain/*
Pick a setting Forwarding URL
Select status code 301 - Permanent Redirect
Enter destination URL https://your complete URL/$1

Note: Please enter "https://" in "Enter destination URL".

 

Example

*Note: This is an example. Please enter your actual domain information when setting up.

For example, if the merchant's full domain name is "www.shopline.tw" and the root domain is "shopline.tw", the Page Rules will be configured as follows:

URL shopline.tw/*
Pick a setting Forwarding URL
Select status code 301 - Permanent Redirect
Enter destination URL https://www.shopline.tw/$1
Example of a Cloudflare page rule set to a 301 permanent redirect

 

Note: Please ensure the page rule is enabled after you create it (as shown below). If disabled, accessing the root domain may result in Error code 525.

Cloudflare page rules list with the action column shown in green, indicating the rule is enabled

Once all the above records are set, you can view them in the DNS records management page.

 

How do I find my subdomain?

Please enter your web store with your browser. Go to your store homepage and check the URL in the address bar. The word in between the [/] & first [.] will be your subdomain (as shown below): 

Location of the subdomain in the store URL shown in the browser address bar

 

Step 5. Wait for propagation

After completing the above settings, please allow some time for the changes to take effect. You can use Google Toolbox: Dig (DNS lookup) to check whether the CNAME record has been successfully applied.

We also recommend contacting our Online Merchant Success Team via the blue chat icon Blue chat icon at the bottom right of the SHOPLINE Admin in the SHOPLINE Admin. Let them know that the setup is complete so they can help you verify and confirm the configuration.

 

Optional

Step 6. Enable Cloudflare Proxy (orange cloud)

Note: This step is optional. Please ensure you have completed all steps through Step 5 and confirmed the CNAME record has taken effect and the SSL/TLS certificate has been successfully issued before proceeding.

You can visit an SSL Checker website and enter your store domain to verify whether the SSL/TLS certificate has been successfully issued. 

For example, if your store domain is: "www.shopline.tw", a successfully issued certificate will appear as shown below:

SSL Checker result showing the store's SSL certificate has been issued

After confirming that the SSL/TLS certificate has been successfully issued and is active, you can switch the subdomain from Proxy Disabled (Gray cloud icon showing the Cloudflare proxy status is DNS only) to Proxy Enabled (Orange cloud icon showing the Cloudflare proxy status is Proxied). 

Once the proxy is enabled, store traffic will first pass through Cloudflare's edge network before being forwarded to the origin server (your web store).

 

*Notes:

  • Before enabling the proxy, please ensure the "Cloudflare Encryption mode" is not set to "Flexible" or "Off (not secure)". You can navigate to [SSL/TLS] > [Overview], then click Configure to view or update the Encryption mode settings.

Configure button for the encryption mode on the Cloudflare SSL/TLS Overview page

  • If the Encryption mode is set to "Flexible" or "Off", visitors may encounter an ERR_TOO_MANY_REDIRECTS error when accessing your store.

 

Example

*Note: This is an example. Please enter your actual domain information when setting up.

Name subdomain
Type CNAME
Target Your complete custom domain.cname.shoplineapp.com
Proxy status

Proxied

Orange cloud icon showing the Cloudflare proxy status is Proxied

 

 

Read more

 

 

 

 

 

Last updated: 18 November 2026

 

Have more questions? Submit a request

Comments