When you deploy your web application to Cloudflare Pages, it gives you a URL like your-project.pages.dev. This is fine if you intend to use it in most production cases, you want to leverage your custom domain.

As you see above, in of my application’s deployment, I got a custom domain and Cloudflare Pages default .pages.dev as well. This is a real issue. It creates duplication, it can get indexed in search engine, which is not good for SEO and security.
As a solution, you should disable the default pages.dev URL given by Cloudflare Pages. Unfortunately, there is no single button to do so, but, I’ll share two workaround solutions.
1. Use Cloudflare Access to restrict access
The first approach is to enable the Cloudflare Access policy, where you can control who should have access.
- Go to your deployed application
- Click on Settings and scroll to the General section, where you’ll find “Access policy”
- Click Enable to configure the policy.
- Once enabled, it will prompt for the necessary credential, depending on your policy configuration.

This is a good approach if you want to access Cloudflare Pages default URL but don’t want to open to the entire world.
Redirect pages.dev to a custom domain
The second solution is to set up a 301 redirection from your default Cloudflare Pages URL to your custom domain. The good thing is, you can use Cloudflare Bulk Redirects to achieve this.
- Go to Bulk Redirects >> Add URLs
- Enter the Pages default URL in Source URL and your custom domain in Target URL
- Leave Status to 301 and click Save

Once saved, wait for a few seconds and hit the Pages default URL. You’ll notice it redirects to your custom domain.
I prefer the redirection solution to disable Pages .dev URL. You might also want to learn about deleting Pages old deployment.