Skip to content

Commit 445c4d7

Browse files
dinasaur404ask-bonk[bot]pedrosousa
authored
[Fundamentals] Add Configuration Rules instructions for Markdown for Agents (#28491)
* [Fundamentals] Add Configuration Rules instructions for Markdown for Agents * Update src/content/partials/fundamentals/markdown-for-agents.mdx Co-authored-by: ask-bonk[bot] <249159057+ask-bonk[bot]@users.noreply.github.com> * Update src/content/partials/fundamentals/markdown-for-agents.mdx Co-authored-by: ask-bonk[bot] <249159057+ask-bonk[bot]@users.noreply.github.com> * Apply suggestions from PCX review --------- Co-authored-by: ask-bonk[bot] <249159057+ask-bonk[bot]@users.noreply.github.com> Co-authored-by: Pedro Sousa <680496+pedrosousa@users.noreply.github.com>
1 parent 0d1f12b commit 445c4d7

1 file changed

Lines changed: 35 additions & 1 deletion

File tree

src/content/partials/fundamentals/markdown-for-agents.mdx

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ To enable Markdown for Agents for your zone in the dashboard:
1313
3. Visit the [AI Crawl Control](https://dash.cloudflare.com/?to=/:account/:zone/ai) section.
1414
4. Enable **Markdown for Agents**.
1515

16+
### Enable for specific subdomains or paths
17+
18+
To enable Markdown for Agents for specific subdomains or paths instead of your entire zone, create a [configuration rule](/rules/configuration-rules/):
19+
20+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/) and select your account.
21+
2. Select the zone you want to configure.
22+
3. Go to **Rules** > **Overview** and select **Create rule** > **Configuration Rules**.
23+
4. Under **When incoming requests match**, build an expression to match your subdomain (for example, `http.host eq "docs.example.com"`) or path.
24+
5. Under **Then the settings are**, select **Add setting** > **Markdown for Agents** and set it to **On**.
25+
6. Select **Deploy**.
26+
1627
</TabItem> <TabItem label="API">
1728

1829
To enable Markdown for Agents for your zone using APIs, send a `PATCH` to `/client/v4/zones/{zone_tag}/settings/content_converter` with the payload `{"value": "on"}` to the Cloudflare API.
@@ -27,6 +38,29 @@ curl -X PATCH 'https://api.cloudflare.com/client/v4/zones/{zone_tag}/settings/co
2738
--header "Authorization: Bearer {api_token}" --data-raw '{"value": "on"}'
2839
```
2940

41+
### Enable for specific subdomains or paths
42+
43+
To enable Markdown for Agents for specific subdomains or paths instead of your entire zone, create a [configuration rule](/rules/configuration-rules/create-api/):
44+
45+
```bash title="Enable Markdown for Agents for a subdomain"
46+
curl --request PUT \
47+
--url "https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets/phases/http_config_settings/entrypoint" \
48+
--header "Authorization: Bearer {api_token}" \
49+
--header "Content-Type: application/json" \
50+
--data '{
51+
"rules": [{
52+
"expression": "http.host eq \"docs.example.com\"",
53+
"action": "set_config",
54+
"action_parameters": {
55+
"content_converter": true
56+
},
57+
"description": "Enable Markdown for Agents for docs subdomain"
58+
}]
59+
}'
60+
```
61+
62+
You can also use path-based expressions like `starts_with(http.request.uri.path, "/blog/")`. For more information on building expressions, refer to [Rules language](/ruleset-engine/rules-language/).
63+
3064
</TabItem> <TabItem label="Custom Hostnames">
3165

3266
If you are using [Cloudflare for SaaS](/cloudflare-for-platforms/cloudflare-for-saas/) and want to enable Markdown for Agents for your [custom hostnames](/cloudflare-for-platforms/cloudflare-for-saas/domain-support/), you have two options:
@@ -83,4 +117,4 @@ curl --request PUT \
83117

84118
This will enable the feature on custom hostnames that have the `content_converter` custom metadata tag set.
85119

86-
</TabItem> </Tabs>
120+
</TabItem> </Tabs>

0 commit comments

Comments
 (0)