> For the complete documentation index, see [llms.txt](https://docs.dnscontrol.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dnscontrol.org/language-reference/domain-modifiers/service-provider-specific/cloudflare-dns/cf_temp_redirect.md).

# CF\_TEMP\_REDIRECT

{% hint style="warning" %}
**WARNING:** Cloudflare is removing this feature and replacing it with a new feature called "Dynamic Single Redirect". DNSControl will automatically generate "Dynamic Single Redirects" for a limited number of use cases. See [`CLOUDFLAREAPI`](/provider/cloudflareapi.md) for details.
{% endhint %}

`CF_TEMP_REDIRECT` uses [Cloudflare](/provider/cloudflareapi.md)-specific features ("Forwarding URL" Page Rules) to generate a HTTP 302 temporary redirect.

If *any* [`CF_REDIRECT`](/language-reference/domain-modifiers/service-provider-specific/cloudflare-dns/cf_redirect.md) or `CF_TEMP_REDIRECT functions are used then` dnscontrol\` will manage *all* "Forwarding URL" type Page Rules for the domain. Page Rule types other than "Forwarding URL" will be left alone.

{% hint style="warning" %} **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 preview` output before running `dnscontrol push`. This is especially true when mixing Page Rules that are managed by DNSControl and those that aren't. {% endhint %}

This example redirects the bare (aka apex, or naked) domain to www:

{% code title="dnsconfig.js" %}

```javascript
D("example.com", REG_MY_PROVIDER, DnsProvider(DSP_MY_PROVIDER),
  CF_TEMP_REDIRECT("example.com/*", "https://www.example.com/$1"),

);
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.dnscontrol.org/language-reference/domain-modifiers/service-provider-specific/cloudflare-dns/cf_temp_redirect.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
