How to redirect Cloudflare Pages's default domain to a Custom Domain

I recently hosted my static website on Cloudflare Pages and everything is going well, except for one issue. I’m having trouble redirecting the default web address (i.e., ***…pages.dev) to my custom domain (e.g., myexampledomain. com). I want visitors who enter the default web address to be automatically redirected to my custom domain, to avoid any duplicate content issues on Google.

How can I set up this redirect on Cloudflare Pages? Thanks in advance for your help!

Hi @gtmboro

As mentioned in this thread there is no way (currently) using Redirects as domain-level redirects are not possible.

An advanced mode or middleware function could handle this.

Setting a canonical Link header via the _headers file using a :splat may help too.

1 Like

Thank you for your suggestions and for taking the time to help me with this issue. Unfortunately, I’m trying so hard of all the methods you suggested, but the issue still persists. As a beginner or non technical guy, it feels quite challenging to navigate technical aspects of this things.

Anyway, Thank you again for your time and help. :slightly_smiling_face:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.