{"id":38,"date":"2015-03-05T10:19:00","date_gmt":"2015-03-05T10:19:00","guid":{"rendered":"https:\/\/www.tech-and-dev.com\/blog\/2015\/03\/05\/forwarding-a-domain-name-to-a-new-domain-using-cloudflare\/"},"modified":"2021-02-22T01:03:41","modified_gmt":"2021-02-22T01:03:41","slug":"forwarding-domain-name-to-new-domain-using-cloudflare","status":"publish","type":"post","link":"https:\/\/www.tech-and-dev.com\/blog\/2015\/03\/forwarding-domain-name-to-new-domain-using-cloudflare.html","title":{"rendered":"Forwarding a Domain Name to a New Domain Using Cloudflare"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align: left;\">\n<div style=\"clear: both; text-align: center;\"><img decoding=\"async\" title=\"Cloudflare\" src=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/cloudflare.jpg\" alt=\"Cloudflare Logo\" border=\"0\" \/><\/div>\n<p>&nbsp;<\/p>\n<div style=\"text-align: justify;\">Lately, I moved my domain names to namesilo, and I noticed that their domain forwarding option will only forward the root domain, rather than all the pages or virtual directories within that domain.<\/div>\n<div style=\"text-align: justify;\"><\/div>\n<div style=\"text-align: justify;\">I decided to park my DNS on cloudflare since it&#8217;s for free and forward the domain and all its pages to the new domain name.<\/div>\n<p><a name=\"more\"><\/a><\/p>\n<div style=\"text-align: justify;\">First, <span style=\"color: #990000;\">add CNAME records to point to the domain you want<\/span>, in my case I&#8217;m pointing my old domain name to www.tech-and-dev.com. for example:<\/div>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/adding2Bdomain2Bin2Bcloudflare.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Adding CNAME from old domain to new domain\" src=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/adding2Bdomain2Bin2Bcloudflare.png\" alt=\"Adding CNAME from old domain to new domain in cloudflare\" width=\"400\" height=\"20\" border=\"0\" \/><\/a><\/div>\n<p>&nbsp;<\/p>\n<div style=\"text-align: justify;\">and if you want to forward the www version too, add another CNAME with www:<\/div>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/adding2Bwww2Bdomain2Bin2Bcloudflare.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Adding CNAME from old domain to new domain\" src=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/adding2Bwww2Bdomain2Bin2Bcloudflare.png\" alt=\"Adding CNAME from old domain to new domain in cloudflare\" width=\"400\" height=\"23\" border=\"0\" \/><\/a><\/div>\n<p>After adding the CNAMES, <span style=\"color: #990000;\">make sure to tick the cloud button<\/span>:<\/p>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/cloudflare-accelerated.png\"><img decoding=\"async\" src=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/cloudflare-accelerated.png\" border=\"0\" \/><\/a><\/div>\n<p>Save the DNS records, and go back to the Websites list, and <span style=\"color: #990000;\">click on the settings icon next to the domain name<\/span>, and choose &#8220;Page Rules&#8221;.<\/p>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/cloudflare-page-rules.png\"><img decoding=\"async\" title=\"Cloudflare Page Rules\" src=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/cloudflare-page-rules.png\" alt=\"Cloudflare Page Rules\" border=\"0\" \/><\/a><\/div>\n<p><span style=\"color: #990000;\">Turn <b>Forwarding<\/b><\/span> <b><span style=\"color: #274e13;\">On<\/span><\/b> <span style=\"color: #990000;\">and enter the first rule:<\/span><\/p>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/first-rule-cf.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/first-rule-cf.png\" width=\"400\" height=\"205\" border=\"0\" \/><\/a><\/div>\n<p>&nbsp;<\/p>\n<div style=\"text-align: justify;\">In the above screenshot, I&#8217;m forwarding myolddomain.com to this domain (www.tech-and-dev.com) and forwarding all the virtual directories of that domain.<\/div>\n<div style=\"text-align: justify;\">The asterisk * in the pattern URL will match any text entered after the domain name and can be used in the Forwarding URL. First asterisk will be $1, 2nd asterisk $2&#8230;.<\/div>\n<p>&nbsp;<\/p>\n<div style=\"text-align: justify;\"><span style=\"color: #990000;\">If you want to forward www.myolddomain.com to the same domain<\/span>, create another similar rule but with www:<\/div>\n<p>&nbsp;<\/p>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/first-rule-cloudflare.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.tech-and-dev.com\/blog\/wp-content\/uploads\/2021\/02\/first-rule-cloudflare.png\" width=\"400\" height=\"240\" border=\"0\" \/><\/a><\/div>\n<p><b>That&#8217;s it! Any comments? Please post them below!<\/b><\/p>\n<p>&nbsp;<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Lately, I moved my domain names to namesilo, and I noticed that their domain forwarding option will only forward the root domain, rather than all the pages or virtual directories within that domain. I decided to park my DNS on cloudflare since it&#8217;s for free and forward the domain and all its pages to [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[54,55],"tags":[],"class_list":["post-38","post","type-post","status-publish","format-standard","hentry","category-cloudflare","category-domain-name"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.tech-and-dev.com\/blog\/wp-json\/wp\/v2\/posts\/38","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tech-and-dev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tech-and-dev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tech-and-dev.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tech-and-dev.com\/blog\/wp-json\/wp\/v2\/comments?post=38"}],"version-history":[{"count":2,"href":"https:\/\/www.tech-and-dev.com\/blog\/wp-json\/wp\/v2\/posts\/38\/revisions"}],"predecessor-version":[{"id":306,"href":"https:\/\/www.tech-and-dev.com\/blog\/wp-json\/wp\/v2\/posts\/38\/revisions\/306"}],"wp:attachment":[{"href":"https:\/\/www.tech-and-dev.com\/blog\/wp-json\/wp\/v2\/media?parent=38"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tech-and-dev.com\/blog\/wp-json\/wp\/v2\/categories?post=38"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tech-and-dev.com\/blog\/wp-json\/wp\/v2\/tags?post=38"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}