大网数据广告活动
网站运营与故障问答

Is it possible to redirect Cloudflare's pages url to the main domain (from someurl.pages.dev to someurl.com)?

· 52CE 我爱测

Is it possible to redirect example.pages.dev to example.com using Cloudflare's DNS dashboard or pages? So basically what I want is if someone visits example.pages.dev , the person should be redirected to example.com . Note: examp…

问题原文

原帖链接 · Imran Zahoor · CC BY-SA 4.0

Is it possible to redirect example.pages.dev to example.com using Cloudflare's DNS dashboard or pages?

So basically what I want is if someone visits example.pages.dev, the person should be redirected to example.com.

Note: example.com is pointing to example.pages.dev via CNAME entry inside Cloudflare's DNS dashboard already. Please also note that example.pages.dev is generated by Cloudflare's pages and is not in our control.

Please also clarify if Google will index the pages as duplicate? Because they'll be accessible from the URL generated by Cloudflare Pages on sub-domain and they'll also be available on main domain.

Will Google indexing these two pages and detect them as duplicates?

  • example.com/some-page
  • example.pages.dev/some-page

已采纳解答

原帖链接 · Stephen Ostermiller · CC BY-SA 4.0

A similar question has been asked and answered in the Cloudflare pages forum: Cloudflare Pages, custom domain - General - Cloudflare Community.

The answer as of July 2021 was that functionality for hiding the pages.dev domain by redirecting to the custom domain isn't available. Instead you should use rel canonical link tags in the head of every page of your site to tell search engines which of the duplicate URLs is your preferred URL.

Having your site available on an alternate domain shouldn't hurt your SEO, especially if you use canonical tags. When Google encounters duplicate content it typically chooses one of the two duplicate URLs to index and ignores the other. With canonical meta tags, you can ensure that Google chooses the correct variant. See What is duplicate content and how can I avoid being penalized for it on my site?

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2022-05-10)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。