1

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
1
  • Remember that .dev TLD, as all Google TLDs, is "special" in the sense that it is included in the HSTS preloading list, which means browsers will only attempt HTTPS connection to it, and never HTTP, which in turn also means you need to have a proper certificate in place, and that happens BEFORE any kind of HTTP level redirections. May 10 at 14:19

1 Answer 1

1

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?

1
  • Thanks for answering it quickly May 10 at 18:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.