When a site is reachable at both vietnam-it.com and www.vietnam-it.com, Google treats them as two separate URLs even though the content is identical. This causes:
Duplicate content — SEO ranking signals get split instead of consolidated on one canonical domain
Diluted backlinks — some links point to the www version, others to the non-www version
Inconsistent behavior for cookies, SSL, and analytics
The fix: pick one canonical version (here, www.vietnam-it.com) and issue a permanent 301 redirect from the other.
Step 1 — Check your DNS records
In DNS > Records, make sure both records exist and are Proxied (orange cloud):
Type
Name
Content
Proxy status
A / CNAME
vietnam-it.com (apex)
your origin IP/host
Proxied
CNAME
www
vietnam-it.com or origin host
Proxied
Redirect Rules only work when traffic passes through Cloudflare's proxy — keep the cloud icon orange, not grey (DNS only).
Step 2 — Create a Redirect Rule
Go to Rules > Redirect Rules (the modern replacement for legacy Page Rules) → Create rule → choose Single Redirect.
Rule name: Redirect apex to www
When incoming requests match → Custom filter expression → Field: Hostname, Operator: equals, Value: vietnam-it.com
Then → Type: Dynamic → Expression:
concat("https://www.vietnam-it.com", http.request.uri.path)
Enable Preserve query string (keeps ?param=... intact)
Status code: 301 (Permanent Redirect) — tells Google the move is permanent, not a temporary 302
Click Deploy.
Step 3 — Verify SSL
In SSL/TLS > Overview, confirm the mode is Full or Full (strict). Cloudflare's Universal SSL automatically covers both vietnam-it.com and www.vietnam-it.com, so usually nothing else to configure here.
Step 4 — Test it
Open an incognito window and visit https://vietnam-it.com — it should redirect to https://www.vietnam-it.com with a 301 status code (check the Network tab in DevTools to confirm).
If your zone still has legacy Page Rules quota (3 free rules), the old-school approach still works: vietnam-it.com/* → Forwarding URL → 301 → https://www.vietnam-it.com/$1. But Redirect Rules is Cloudflare's current recommended approach — more flexible and available even on the Free plan.
Once the redirect is live, update Google Search Console: set www.vietnam-it.com as the preferred domain and resubmit the sitemap.
Khi website có thể truy cập ở cả hai dạng vietnam-it.com và www.vietnam-it.com, Google sẽ coi đây là hai URL khác nhau dù nội dung giống hệt nhau. Điều này gây ra:
Duplicate content — pha loãng thứ hạng SEO thay vì gom về một domain chuẩn
Phân tán backlink — một số người link tới bản có www, một số link tới bản không có www
Trải nghiệm không nhất quán (cookie, SSL, analytics...)
Giải pháp: chọn một phiên bản chính thức (ở đây là www.vietnam-it.com) và redirect 301 (vĩnh viễn) từ phiên bản còn lại.
Bước 1 — Kiểm tra DNS
Vào DNS > Records, đảm bảo cả hai bản ghi đều tồn tại và đang Proxied (đám mây màu cam):
Type
Name
Content
Proxy status
A / CNAME
vietnam-it.com (apex)
IP hoặc host gốc
Proxied
CNAME
www
vietnam-it.com hoặc host gốc
Proxied
Redirect Rules chỉ hoạt động khi traffic đi qua proxy Cloudflare, nên nhớ để đám mây màu cam, không để màu xám (DNS only).
Bước 2 — Tạo Redirect Rule
Vào Rules > Redirect Rules (mục thay thế cho Page Rules cũ) → Create rule → chọn Single Redirect.
Rule name: Redirect apex to www
When incoming requests match → Custom filter expression → Field: Hostname, Operator: equals, Value: vietnam-it.com
Then → Type: Dynamic → Expression:
concat("https://www.vietnam-it.com", http.request.uri.path)
Bật Preserve query string (giữ lại ?param=... nếu có)
Status code: 301 (Permanent Redirect) — quan trọng để Google hiểu đây là chuyển hướng vĩnh viễn, không phải tạm thời (302)
Nhấn Deploy.
Bước 3 — Kiểm tra SSL
Vào SSL/TLS > Overview, đảm bảo chế độ là Full hoặc Full (strict). Cloudflare Universal SSL sẽ tự cấp chứng chỉ cho cả vietnam-it.com và www.vietnam-it.com nên bước này thường không cần chỉnh gì thêm.
Bước 4 — Test
Mở trình duyệt ẩn danh, truy cập https://vietnam-it.com → phải tự động chuyển sang https://www.vietnam-it.com với mã trạng thái 301 (kiểm tra bằng tab Network trong DevTools).
Nếu domain vẫn còn hạn mức Page Rules cũ (miễn phí 3 rule), có thể dùng cách cũ: vietnam-it.com/* → Forwarding URL → 301 → https://www.vietnam-it.com/$1. Nhưng Redirect Rules là hướng đi Cloudflare khuyến nghị hiện nay, linh hoạt hơn và không giới hạn ở gói Free.
Sau khi redirect ổn định, cập nhật Google Search Console — khai báo www.vietnam-it.com là domain chính (preferred domain) và submit lại sitemap.