Cloudflare Docs
Cloudflare Fundamentals
Edit this page
Report an issue with this page
Log into the Cloudflare dashboard
Set theme to dark (⇧+D)

Redirect one domain to another

If you have an alias domain that only forwards traffic to another domain, you can set up redirects directly within Cloudflare.

  1. Add your alias domain (for example, to Cloudflare.

  2. Make sure that your alias domain has a proxied DNS A or CNAME record that properly resolves DNS queries. You may also want to include a record for the www subdomain.

    TypeNameIPv4 addressProxy status
  3. Use Redirect rules to forward traffic from your alias domain to your other domain.

    This example dynamic redirect will redirect all requests for to a different hostname using HTTPS, keeping the original path and query string.

    When incoming requests match

    • Field: Hostname
    • Operator: equals
    • Value:

    If you are using the Expression Editor, enter the following expression:
    ( eq "")


    • Type: Dynamic
    • Expression: concat("", http.request.uri.path)
    • Status code: 301
    • Preserve query string: Enabled

    For example, the redirect rule would perform the following redirects:

    Request URLTarget URLStatus code