When you change the domain name of your website, it's important to implement the correct redirects to ensure that you don't lose your search engine rankings.
Cloudflare is a free tool that can help you do 301 redirects, which are the best type of redirects for domain name changes.
Notes before changing the domain name for the website
Make a backup of your old website. Then it pushes to the new domain name, or localhost to test errors.
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.
You do not need to use hosting for the old domain name. This redirection is done through Cloudflare.
What is 301 redirect?

A 301 redirect is a type of HTTP redirect that indicates that a website's URL has changed permanently.
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.
This ensures that users can still find your website in search results, even if they have saved a link to your old URL.
There are several benefits to using 301 redirects when you change the domain name of your website, including:
- Preserve your search engine rankings: A 301 redirect will tell Google that you've changed your website'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.
- 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's ranking.
- 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.
How to 301 Redirect Using Cloudflare
To perform a 301 redirect using Cloudflare, you need to follow these steps:
Go to your Cloudflare account and click on the domain name you want to redirect.
If you want to use redirects that no need hosting then must add A record to any IP. My example is 1.2.3.4

Find the section Rules and click Page Rules.

- Click the button Create Page Rule.
- Enter the URL of the old domain name
old-domain.com/* - Select Forwarding URLs → 301 – Permanet Redirect.
- Fill in the new domain URL
https://new-domain.com/$1 - Press Save Page Rule to complete the redirect.

Now check by accessing the old domain name. You will be redirected to the new domain name immediately.
Page Rules Cloudflare is deprecated
- 01/07/2024 – Page Rules are no longer available for new Cloudflare accounts and zones on the Free plan.
- 01/08/2024 – Page Rules are no longer available for new Cloudflare accounts and zones on Pro or Business plans.
- 2024-10-01 – Page Rules are no longer available for new Cloudflare accounts and zones on the Enterprise plan.
- 06/01/2025 – For existing accounts and zones on any plan, you can no longer create new Page Rules (maintenance mode).
- 2025 (full year) – Migrate existing Page Rules to modern Rules features. You cannot edit any existing Page Rules that are eligible for migration during this migration period.
The alternative is to use Redirect Rules
- Select
Custom filter expression - Use rule sets
Hostname equals "old-domain.com" - Or you can fill in the expression
(http.host eq "old-domain.com")
Item Then:
- Type selected
Dynamic - Fill expression
concat("https://new-domain.com", http.request.uri.path) - Status code select 301.
- Check the box
Preserve query stringso that queries are preserved when redirected. - Press
Deployto save.

Notify Google about changing the new domain name
You need to add the new domain name to the Google Search Console tool.
From the old domain management interface → Select Settings → Change of address.
Select the new domain you need to redirect → Click VALIDATE & UPDATE.

So it'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.

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.
Before canceling the old domain name you also need to check if there are any unredirected URLs by typing in the search bar: site:domain.com








Comment