{"id":976,"date":"2018-05-03T11:20:12","date_gmt":"2018-05-03T11:20:12","guid":{"rendered":"https:\/\/chemicloud.com\/kb\/?post_type=article&#038;p=976"},"modified":"2024-06-27T19:23:56","modified_gmt":"2024-06-27T19:23:56","slug":"enable-cloudflare-subdomain","status":"publish","type":"ht_kb","link":"https:\/\/chemicloud.com\/kb\/article\/enable-cloudflare-subdomain\/","title":{"rendered":"How to enable Cloudflare for a subdomain"},"content":{"rendered":"<p class=\"p1\">Cloudflare services are enabled for a given domain name and once activated can also be applied for any of its subdomains.<\/p>\n<p class=\"p1\">Before you can use Cloudflare for a subdomain, you would have to enable the service for your main domain.<\/p>\n<p>If your subdomain is created using cPanel, the process of enabling Cloudflare for it involves additional steps to ensure proper DNS configuration.<\/p>\n<p>Here&#8217;s how you can do it:<\/p>\n<ol>\n<li><strong>Login to cPanel<\/strong>:\n<ul>\n<li>Access your cPanel account provided by your hosting provider.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Create the Subdomain<\/strong> (if not already created):<strong>1)<\/strong>\u00a0Locate the \u2018DOMAINS\u2019 section and click the\u00a0<strong>Domains<\/strong>\u00a0icon<br \/>\n<figure id=\"attachment_7613\" class=\"wp-caption alignnone\" aria-describedby=\"caption-attachment-7613\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-7613\" style=\"box-sizing: border-box; height: auto; max-width: 100%; border-style: none; display: block;\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/02\/cPanel-Domains-1-783x193.png\" sizes=\"auto, (max-width: 643px) 100vw, 643px\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/02\/cPanel-Domains-1-783x193.png 783w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/02\/cPanel-Domains-1-300x74.png 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/02\/cPanel-Domains-1-768x189.png 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/02\/cPanel-Domains-1-50x12.png 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/02\/cPanel-Domains-1-1536x378.png 1536w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/02\/cPanel-Domains-1-60x15.png 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/02\/cPanel-Domains-1-100x25.png 100w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2020\/02\/cPanel-Domains-1.png 1754w\" alt=\"cPanel &gt; Domains\" width=\"643\" height=\"158\" \/><figcaption id=\"caption-attachment-7613\" class=\"wp-caption-text\">cPanel &gt; Domains<\/figcaption><\/figure>\n<p><strong>2)<\/strong>\u00a0Click on the<strong>\u00a0Create A New Domain<\/strong>\u00a0button<\/p>\n<figure id=\"attachment_7620\" class=\"wp-caption alignnone\" aria-describedby=\"caption-attachment-7620\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-7620\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/cPanel-Domains-Create-a-New-Domain-783x165.png\" sizes=\"auto, (max-width: 643px) 100vw, 643px\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/cPanel-Domains-Create-a-New-Domain-783x165.png 783w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/cPanel-Domains-Create-a-New-Domain-300x63.png 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/cPanel-Domains-Create-a-New-Domain-768x162.png 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/cPanel-Domains-Create-a-New-Domain-50x11.png 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/cPanel-Domains-Create-a-New-Domain-1536x324.png 1536w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/cPanel-Domains-Create-a-New-Domain-2048x432.png 2048w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/cPanel-Domains-Create-a-New-Domain-60x13.png 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/cPanel-Domains-Create-a-New-Domain-100x21.png 100w\" alt=\"Create a subdomain in cPanel\" width=\"643\" height=\"135\" \/><figcaption id=\"caption-attachment-7620\" class=\"wp-caption-text\">cPanel &gt; Domains &gt; Create a New Domain<\/figcaption><\/figure>\n<p><strong>3)<\/strong>\u00a0Enter the following information:<\/p>\n<ul>\n<li>\n<p class=\"no-margin\"><b>Domain<\/b>: enter the subdomain that you want to create<\/p>\n<\/li>\n<li>\n<p class=\"no-margin\"><b>Document root<\/b>: leave the checkmark empty for the\u00a0<em>Share document root<\/em>\u00a0option.<\/p>\n<\/li>\n<li>\n<p class=\"no-margin\"><b>Home icon<\/b>: choose a subdirectory for it in your account\u2019s home directory (above public_html). This subdirectory will store your subdomain\u2019s files.<\/p>\n<\/li>\n<\/ul>\n<figure id=\"attachment_7621\" class=\"wp-caption alignnone\" aria-describedby=\"caption-attachment-7621\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-7621\" src=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Domains-Create-a-New-Domain-Field-783x446.png\" sizes=\"auto, (max-width: 643px) 100vw, 643px\" srcset=\"https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Domains-Create-a-New-Domain-Field-783x446.png 783w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Domains-Create-a-New-Domain-Field-300x171.png 300w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Domains-Create-a-New-Domain-Field-768x438.png 768w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Domains-Create-a-New-Domain-Field-50x29.png 50w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Domains-Create-a-New-Domain-Field-1536x876.png 1536w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Domains-Create-a-New-Domain-Field-60x34.png 60w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Domains-Create-a-New-Domain-Field-100x57.png 100w, https:\/\/chemicloud.com\/kb\/wp-content\/uploads\/2017\/05\/Domains-Create-a-New-Domain-Field.png 1540w\" alt=\"\" width=\"643\" height=\"366\" \/><figcaption id=\"caption-attachment-7621\" class=\"wp-caption-text\">Domains &gt; Create a New Subdomain<\/figcaption><\/figure>\n<div class=\"hts-messages hts-messages--info hts-messages--withicon \">\n<p>By default cPanel automatically fills in the details for the\u00a0<em>document root<\/em>. You can either leave them as default or modify the information.<\/p>\n<\/div>\n<p><strong>5)<\/strong>\u00a0The last step is to click\u00a0<strong>Submit\u00a0<\/strong>button<strong>. \u00a0<\/strong>The subdomain will be created.<\/li>\n<li><strong>Login to Cloudflare<\/strong>:\n<ul>\n<li>Go to the <a href=\"https:\/\/www.cloudflare.com\" target=\"_blank\" rel=\"nofollow noopener\">Cloudflare website<\/a> and log in to your account.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Add Your Main Domain<\/strong>:\n<ul>\n<li>If you haven\u2019t already added your main domain to Cloudflare, you\u2019ll need to do this first.<\/li>\n<li>Click on \u201cAdd Site\u201d and enter your main domain name.<\/li>\n<li>Follow the prompts to configure your DNS settings and update your nameservers to Cloudflare&#8217;s.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Navigate to DNS Settings in Cloudflare<\/strong>:\n<ul>\n<li>Once your main domain is added and the nameservers are updated, go to the dashboard.<\/li>\n<li>Select your domain to open its settings.<\/li>\n<li>Click on the \u201cDNS\u201d tab to access the DNS management page.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Add a DNS Record for the Subdomain<\/strong>:\n<ul>\n<li>In the DNS management page, you will likely see the DNS records that were automatically imported.<\/li>\n<li>Check if the subdomain record exists (it should if created via cPanel).<\/li>\n<li>If it does not exist, add a new DNS record:\n<ul>\n<li>Choose the type of record (usually \u201cA\u201d or \u201cCNAME\u201d).<\/li>\n<li>For an \u201cA\u201d record, enter the subdomain in the \u201cName\u201d field and the IP address of your server in the \u201cIPv4 address\u201d field.<\/li>\n<li>For a \u201cCNAME\u201d record, enter the subdomain in the \u201cName\u201d field and the canonical name (the domain that this subdomain should point to) in the \u201cDomain name\u201d field.<\/li>\n<\/ul>\n<\/li>\n<li>Ensure the cloud icon next to the DNS record is orange, indicating that Cloudflare\u2019s proxy is enabled. If it is grey, click it to toggle the proxy on.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Configure SSL\/TLS Settings<\/strong> (Optional but recommended)**:\n<ul>\n<li>Go to the \u201cSSL\/TLS\u201d tab.<\/li>\n<li>Choose the appropriate SSL mode (Flexible, Full, Full (strict)) based on your server\u2019s SSL configuration.<\/li>\n<li>It\u2019s generally recommended to use \u201cFull (strict)\u201d if you have a valid SSL certificate installed on your server.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Page Rules for Subdomains<\/strong> (Optional)**:\n<ul>\n<li>If you want to create specific rules for your subdomain, go to the \u201cPage Rules\u201d tab.<\/li>\n<li>Click \u201cCreate Page Rule\u201d and enter the subdomain URL (e.g., <code>sub.example.com\/*<\/code>).<\/li>\n<li>Configure the settings as needed, such as caching level, SSL settings, etc.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Test Your Configuration<\/strong>:\n<ul>\n<li>After setting up the DNS record and SSL settings, wait for the DNS propagation to complete.<\/li>\n<li>Visit your subdomain in a browser to ensure it\u2019s resolving correctly and is being proxied through Cloudflare.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>By following these steps, you should be able to enable Cloudflare for your cPanel-created subdomain successfully. If you encounter any issues, you can check with your web hosting provider\u00a0for additional help and troubleshooting.<\/p>\n<p>You find this article useful? Click here to learn more about ChemiCloud <a href=\"https:\/\/chemicloud.com\"><strong>web hosting<\/strong><\/a> experts and what else we can do for you!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cloudflare services are enabled for a given domain name and once activated can also be applied for any of its subdomains. Before you can use Cloudflare for a subdomain, you would have to enable the service for your main domain. If your subdomain is created using cPanel, the process of&#8230;<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"ht-kb-category":[191],"ht-kb-tag":[],"class_list":["post-976","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-website-speed"],"_links":{"self":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/976","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/comments?post=976"}],"version-history":[{"count":8,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/976\/revisions"}],"predecessor-version":[{"id":8222,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/976\/revisions\/8222"}],"wp:attachment":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/media?parent=976"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb-category?post=976"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb-tag?post=976"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}