Redirecting *.pages.dev to a Custom Domain

Last updated Apr 21, 2026 Learn how to use Bulk Redirects to redirect your *.pages.dev subdomain to your custom domain.

You may want to do this to ensure that your site's content is served only on the custom domain, and not the <project>.pages.dev site automatically generated on your first Pages deployment.

Setup

To redirect a <project>.pages.dev subdomain to your custom domain:

  1. In the Cloudflare dashboard, go to the Workers & Pages page. Go to Workers & Pages ↗
  2. Select your Pages project.
  3. Go to Custom domains and make sure that your custom domain is listed. If it is not, add it by clicking Set up a custom domain.
  4. Go Bulk Redirects.
  5. Create a bulk redirect list modeled after the following (but replacing the values as appropriate):
Source URL Target URL Status Parameters
<project>.pages.dev https://example.com 301 <ul><li>Preserve query string</li><li>Subpath matching</li><li>Preserve path suffix</li><li>Include subdomains</li></ul>
  1. Create a bulk redirect rule using the list you just created.

To test that your redirect worked, go to your <project>.pages.dev domain. If the URL is now set to your custom domain, then the rule has propagated.

Was this helpful?

YesNo

On this page

Redirecting \*.pages.dev to a Custom Dom - 图1Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/pages/how-to/redirect-to-custom-domain/#page","headline":"Redirecting *.pages.dev to a Custom Domain","description":"Use Bulk Redirects to redirect your pages.dev subdomain to a custom domain.","url":"https://developers.cloudflare.com/pages/how-to/redirect-to-custom-domain/","inLanguage":"en","image":"https://developers.cloudflare.com/pages/how-to/redirect-to-custom-domain/og.png?v=36d847456d6f6efb","dateModified":"2026-04-21","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}


description: Migrate an existing Cloudflare Worker into a Pages Function for your Pages project. title: Refactor a Worker to a Pages Function image: https://developers.cloudflare.com/pages/how-to/refactor-a-worker-to-pages-functions/og.png?v=e1fbd41e9d230e26


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/pages/llms.txt
Use this file to discover all available pages before exploring further.