How do I get rid of the default Pages domain altogether when using a custom domain?
I have a cloudflare Pages application running, and as such it is accessible using
project-name.pages.dev
, but I also have it setup to use a custom domain example.com
(the custom domain is managed by cloudflare dns). How do I prevent the project-name.pages.dev
domain from being active, there fore only allowing access from example.com
?4 Replies
No functionality to disable it at the moment, we recommend redirecting it to a custom domain: https://developers.cloudflare.com/pages/how-to/redirect-to-custom-domain/
Redirecting *.pages.dev to a Custom Domain · Cloudflare Pages docs
Learn how to use Bulk Redirects to redirect your *.pages.dev subdomain to your custom domain (example.com). You may want to do this to ensure that …
perfect, this is probably adequate in my case
It ensures no content can be loaded from that domain and anyone who for some reason lands at the pages.dev will get taken to the right place instead
also helps with SEO, you wont have duplicate content anymore
thanks for the quick support, marking as solved :)