Redirect *.pages.dev to a custom domain
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 *.pages.dev
site automatically generated on your first Pages deployment.
Setup
To redirect a *.pages.dev
subdomain to your custom domain:
- Log in to the Cloudflare dashboard, and select your account.
- Select Workers & Pages and select your Pages application.
- 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.
- Go Bulk Redirects.
- Create a bulk redirect list modeled after the following (but replacing the values as appropriate):
Source URL | Target URL | Status | Parameters |
---|---|---|---|
*.pages.dev | https://example.com | 301 |
|
- Create a bulk redirect rule using the list you just created.
To test that your redirect worked, go to your *.pages.dev
domain. If the URL is now set to your custom domain, then the rule has propagated.