{"id":1421,"date":"2023-07-17T20:28:00","date_gmt":"2023-07-17T13:28:00","guid":{"rendered":"https:\/\/dev.artru.io.vn\/?p=1421"},"modified":"2024-05-19T09:02:35","modified_gmt":"2024-05-19T02:02:35","slug":"doi-ten-mien-khong-mat-thu-hang-bang-cloudflare","status":"publish","type":"post","link":"https:\/\/artru.net\/en\/doi-ten-mien-khong-mat-thu-hang-bang-cloudflare\/","title":{"rendered":"Change your domain name without losing rankings with Cloudflare"},"content":{"rendered":"<p class=\"wp-block-paragraph\">When you change the domain name of your website, it&#039;s important to implement the correct redirects to ensure that you don&#039;t lose your search engine rankings.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Cloudflare is a free tool that can help you do 301 redirects, which are the best type of redirects for domain name changes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Notes before changing the domain name for the website<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Make a backup of your old website. Then it pushes to the new domain name, or localhost to test errors.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Make sure that the old domain name is still valid so that the redirection to the new domain name is not interrupted. Because this process can take a few days or months depending on the number of indexed links of the old web.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You do not need to use hosting for the old domain name. This redirection is done through Cloudflare.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is 301 redirect?<\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"206\" src=\"https:\/\/cdn.artru.eu.org\/wp-content\/uploads\/2023\/07\/301-redirect.png\" alt=\"301 redirects\" class=\"wp-image-1443\"\/><figcaption class=\"wp-element-caption\">301 redirects<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">A 301 redirect is a type of HTTP redirect that indicates that a website&#039;s URL has changed permanently.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When Googlebot or other search engines visit a website with a 301 redirect, they notice that the URL has changed and update their index to reflect the new URL.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This ensures that users can still find your website in search results, even if they have saved a link to your old URL.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are several benefits to using 301 redirects when you change the domain name of your website, including:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Preserve your search engine rankings: A 301 redirect will tell Google that you&#039;ve changed your website&#039;s URL and that it should redirect users to the new URL. This will help you maintain your search engine rankings and ensure that users can still find your website.<\/li>\n\n\n\n<li>Preserve link quality: When you redirect users from your old URL to the new URL, you are also converting link credits. This means that any links to your old URL will still count for the new URL&#039;s ranking.<\/li>\n\n\n\n<li>Improved user experience: 301 redirects will ensure that users are redirected to the new URL smoothly and without losing any content. This will help improve the user experience and reduce the risk of them leaving your website.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">How to 301 Redirect Using Cloudflare<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To perform a 301 redirect using Cloudflare, you need to follow these steps:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Go to your Cloudflare account and click on the domain name you want to redirect.<\/p>\n\n\n\n<p class=\"has-vivid-green-cyan-color has-black-background-color has-text-color has-background wp-block-paragraph\">If you want to use redirects that <strong>no need hosting<\/strong> then must add A record to any IP. My example is 1.2.3.4<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"688\" height=\"164\" src=\"https:\/\/cdn.artru.eu.org\/wp-content\/uploads\/2023\/07\/DNS-management-Cloudflare.png\" alt=\"DNS management Cloudflare\" class=\"wp-image-1463\"\/><figcaption class=\"wp-element-caption\">DNS management Cloudflare<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Find the section <strong>Rules <\/strong>and click <strong>Page Rules<\/strong>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"456\" height=\"468\" src=\"https:\/\/cdn.artru.eu.org\/wp-content\/uploads\/2023\/07\/Select-Page-Rules-Cloudflare.png\" alt=\"Select Page Rules Cloudflare\" class=\"wp-image-1446\"\/><figcaption class=\"wp-element-caption\">Select Page Rules Cloudflare<\/figcaption><\/figure>\n<\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>Click the button <strong>Create Page Rule<\/strong>.<\/li>\n\n\n\n<li>Enter the URL of the old domain name <code data-no-translation=\"\" data-no-auto-translation=\"\">old-domain.com\/*<\/code><\/li>\n\n\n\n<li>Select <strong>Forwarding URLs<\/strong> \u2192 <strong>301 - Permanet Redirect<\/strong>.<\/li>\n\n\n\n<li>Fill in the new domain URL <code data-no-translation=\"\" data-no-auto-translation=\"\">https:\/\/new-domain.com\/$1<\/code><\/li>\n\n\n\n<li>Press <strong>Save Page Rule<\/strong> to complete the redirect.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"763\" height=\"435\" src=\"https:\/\/cdn.artru.eu.org\/wp-content\/uploads\/2023\/07\/Forwarding-URL-301-Cloudflare.png\" alt=\"Forwarding URLs 301 Cloudflare\" class=\"wp-image-1449\"\/><figcaption class=\"wp-element-caption\">Forwarding URLs 301 Cloudflare<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Now check by accessing the old domain name. You will be redirected to the new domain name immediately.<\/p>\n\n\n\n<div class=\"wp-block-group has-vivid-red-color has-black-background-color has-text-color has-background has-link-color wp-elements-2029bc03cdb85ac34a923eada54e8fa4\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<p class=\"wp-block-paragraph\"><strong>Page Rules Cloudflare is deprecated<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>01\/07\/2024\u00a0<\/strong>\u2013 Page Rules are no longer available for new Cloudflare accounts and zones on the Free plan.<\/li>\n\n\n\n<li><strong>01\/08\/2024\u00a0<\/strong>\u2013 Page Rules are no longer available for new Cloudflare accounts and zones on Pro or Business plans.<\/li>\n\n\n\n<li><strong>2024-10-01\u00a0<\/strong>\u2013 Page Rules are no longer available for new Cloudflare accounts and zones on the Enterprise plan.<\/li>\n\n\n\n<li><strong>06\/01\/2025\u00a0<\/strong>\u2013 For existing accounts and zones on any plan, you can no longer create new Page Rules (maintenance mode).<\/li>\n\n\n\n<li><strong>2025 (full year)\u00a0<\/strong>\u2013 Migrate existing Page Rules to modern Rules features. You cannot edit any existing Page Rules that are eligible for migration during this migration period.<\/li>\n<\/ul>\n<\/div><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">The alternative is to use <code data-no-translation=\"\" data-no-auto-translation=\"\">Redirect Rules<\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Select <code data-no-translation=\"\" data-no-auto-translation=\"\">Custom filter expression<\/code><\/li>\n\n\n\n<li>Use rule sets <code data-no-translation=\"\" data-no-auto-translation=\"\">Hostname equals \"old-domain.com\"<\/code><\/li>\n\n\n\n<li>Or you can fill in the expression <code data-no-translation=\"\" data-no-auto-translation=\"\">(http.host eq \"old-domain.com\")<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Item <code data-no-translation=\"\" data-no-auto-translation=\"\">Then<\/code>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Type selected <code data-no-translation=\"\" data-no-auto-translation=\"\">Dynamic<\/code><\/li>\n\n\n\n<li>Fill expression <code data-no-translation=\"\" data-no-auto-translation=\"\">concat(\"https:\/\/new-domain.com\", http.request.uri.path)<\/code><\/li>\n\n\n\n<li>Status code select 301.<\/li>\n\n\n\n<li>Check the box <code data-no-translation=\"\" data-no-auto-translation=\"\">Preserve query string<\/code> so that queries are preserved when redirected.<\/li>\n\n\n\n<li>Press <code data-no-translation=\"\" data-no-auto-translation=\"\">Deploy<\/code> to save.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1216\" height=\"708\" src=\"https:\/\/cdn.artru.eu.org\/wp-content\/uploads\/2024\/05\/Redirect-Rules-301-Cloudflare.png\" alt=\"Redirect Rule 301 Cloudflare\" class=\"wp-image-4870\"\/><figcaption class=\"wp-element-caption\">Redirect Rule 301 Cloudflare<\/figcaption><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">Notify Google about changing the new domain name<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You need to add the new domain name to the Google Search Console tool.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">From the old domain management interface \u2192 Select <strong>Settings<\/strong> \u2192 <strong>Change of address<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Select the new domain you need to redirect \u2192 Click <strong>VALIDATE &amp; UPDATE<\/strong>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"621\" height=\"478\" src=\"https:\/\/cdn.artru.eu.org\/wp-content\/uploads\/2023\/07\/Change-of-address-GSC.png\" alt=\"Change of address GSC\" class=\"wp-image-1451\"\/><figcaption class=\"wp-element-caption\">Change of address GSC<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">So it&#039;s done. The rest is to wait or you can index manually quickly. It took me 2 hours to redirect and a few posts appeared already.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"904\" height=\"290\" src=\"https:\/\/cdn.artru.eu.org\/wp-content\/uploads\/2023\/07\/This-site-is-currently-moving-GSC.png\" alt=\"This site is currently moving GSC\" class=\"wp-image-1454\"\/><figcaption class=\"wp-element-caption\">This site is currently moving GSC<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">In addition to using 301 redirects, you can also notify your users that you are switching to a new domain. You can send notifications via email or on social networks.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before canceling the old domain name you also need to check if there are any unredirected URLs by typing in the search bar: <code data-no-translation=\"\" data-no-auto-translation=\"\">site:domain.com<\/code><\/p>","protected":false},"excerpt":{"rendered":"<p>Khi b\u1ea1n \u0111\u1ed5i t\u00ean mi\u1ec1n cho website c\u1ee7a m\u00ecnh, \u0111i\u1ec1u quan tr\u1ecdng l\u00e0 ph\u1ea3i th\u1ef1c hi\u1ec7n chuy\u1ec3n h\u01b0\u1edbng ch\u00ednh x\u00e1c \u0111\u1ec3 \u0111\u1ea3m b\u1ea3o r\u1eb1ng b\u1ea1n kh\u00f4ng m\u1ea5t th\u1ee9 h\u1ea1ng trong [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1442,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[117],"class_list":["post-1421","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-seo","tag-cloudflare"],"_links":{"self":[{"href":"https:\/\/artru.net\/en\/wp-json\/wp\/v2\/posts\/1421","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/artru.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/artru.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/artru.net\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/artru.net\/en\/wp-json\/wp\/v2\/comments?post=1421"}],"version-history":[{"count":0,"href":"https:\/\/artru.net\/en\/wp-json\/wp\/v2\/posts\/1421\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/artru.net\/en\/wp-json\/wp\/v2\/media\/1442"}],"wp:attachment":[{"href":"https:\/\/artru.net\/en\/wp-json\/wp\/v2\/media?parent=1421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/artru.net\/en\/wp-json\/wp\/v2\/categories?post=1421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/artru.net\/en\/wp-json\/wp\/v2\/tags?post=1421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}