We use cookies to ensure you get the best experience on our website. Read our privacy policy

Skip to main content
Cloudflare Pages Redirect .pages.dev to Your Domain illustration
Home Blog Cloudflare

How To Redirect .pages.dev to Your Domain

Learn how to redirect .pages.dev to your domain with this step-by-step guide

Published on:
Clock Time to complete: 10 minutes

When you deploy a site with Cloudflare Pages, it automatically creates a subdomain on pages.dev (like yourdomain.pages.dev). While this is convenient for testing, you’ll typically want visitors to only access your site through your custom domain. Redirecting your .pages.dev domain to your custom domain offers several benefits:

  • Check Circle

    Prevents duplicate content issues that can harm SEO

  • Check Circle

    Ensures consistent analytics tracking under a single domain

  • Check Circle

    Maintains brand consistency by using only your official domain

  • Check Circle

    Simplifies URL management and sharing

If you’re interested in creating a staging environment for your site, the steps in this guide will be unnecessary. You can follow our guide below that also covers .pages.dev redirects including a staging environment.

Cloudflare Pages Staging Environment illustration showing preview deployments

Create A Staging Environment For Cloudflare Pages

Set up a secure, password-protected staging environment for your Cloudflare Pages site with this step-by-step guide

Follow these steps to redirect your .pages.dev domain to your custom domain:

  1. Log in to your Cloudflare dashboard
  2. Click on “Bulk Redirects” at the bottom of the left sidebar
Cloudflare Bulk Redirects

If you don’t already have a redirect list:

  1. Click “Create bulk redirect list”
  2. Give your list a descriptive name (e.g., “pages_dev_redirects”)
  3. Under the “Add URLs” section, click “Manually add URL redirects”
  4. Enter the following details (replacing yourdomain with your actual domain):
    • Source URL: yourdomain.pages.dev/
    • Target URL: https://yourdomain.com/
    • Status code: 301 (Permanent Redirect)
  5. Check all parameter options under “edit parameters”
  6. Click “Save and continue”
  7. On the next screen, click “Continue to redirect rules”
  8. Give your rule a name (e.g., “pages_redirects”)
  9. Click “Save and deploy”
Cloudflare Bulk Redirect Settings

Limited Time Launch Sale

Our AstroJS starter template saves you time and ensures proper SEO practices from day one.

GET 60% OFF!
  1. Open an incognito browser window (to avoid cached results)
  2. Visit your pages.dev URL (e.g., yourdomain.pages.dev)
  3. You should be automatically redirected to your custom domain
  4. Try visiting a specific page on your pages.dev domain to ensure path preservation works
  • Redirect not active: Redirects can take a few minutes to propagate. Wait 5-10 minutes and try again.
  • Caching issues: Your browser might be caching the old response. Try in an incognito window or clear your browser cache.
  • Parameter settings: Ensure you’ve checked the appropriate parameter settings to preserve paths and query strings.

This redirect approach uses a 301 (permanent) redirect, which is the best option for SEO. This tells search engines that your content has permanently moved to the new location, and they should transfer any ranking signals to your custom domain.

After implementing the redirect, you may want to:

  1. Update your Google Search Console to include your custom domain as the primary property
  2. Submit your sitemap through your custom domain
  3. Monitor for any crawl errors related to the redirect

By redirecting your .pages.dev domain to your custom domain, you’ve taken an important step in maintaining a consistent online presence and optimizing your site for search engines. This simple configuration ensures that all visitors arrive at your branded domain, regardless of which URL they initially access.

For more details you can check out the Cloudflare Pages documentation.

Related Articles

Read more Cloudflare articles
North Star Themes Logo

Subscribe to our newsletter

Get the latest AstroJS tips and tricks right to your inbox

Email: [email protected]

© 2025 North Star Themes

Web Kit Provided By North Star Themes