跳到正文
文章中级

按条件启用 Turnstile

只对特定请求显示 Turnstile(例如为受信任的智能体跳过),可通过转换规则或 Worker 中的 HTMLRewriter 实现。

最近更新
2026年11月17日
阅读原文

该介绍目前仅提供英文版本。

Sometimes only some visitors should see Turnstile — for example, an approved agent submitting a form. This tutorial shows two approaches: pass request information to your site in a header with a Transform Rule, or remove the widget from the response with HTMLRewriter in a Worker.

What you’ll learn

  • Use a Transform Rule to flag selected agents
  • Use HTMLRewriter to strip the widget for some requests

Cloudflare products used

Turnstile, Rules, Workers.

Follow the full, step-by-step tutorial in Cloudflare’s documentation.

继续学习