Comment on page
CF_REDIRECTuses Cloudflare-specific features ("Forwarding URL" Page Rules) to generate a HTTP 301 permanent redirect.
CF_TEMP_REDIRECTfunctions are used then
dnscontrolwill manage all "Forwarding URL" type Page Rules for the domain. Page Rule types other than "Forwarding URL” will be left alone.
WARNING: Cloudflare does not currently fully document the Page Rules API and this interface is not extensively tested. Take precautions such as making backups and manually verifying
dnscontrol previewoutput before running
dnscontrol push. This is especially true when mixing Page Rules that are managed by DNSControl and those that aren't.
HTTP 301 redirects are cached by browsers forever, usually ignoring any TTLs or other cache invalidation techniques. It should be used with great care. We suggest using a
CF_TEMP_REDIRECTinitially, then changing to a
CF_REDIRECTonly after sufficient time has elapsed to prove this is what you really want.
This example redirects the bare (aka apex, or naked) domain to www:
D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),