WeSearch

Cloudflare CAPTCHA on at least one ampersand

Simon Willison· ·1 min read · 0 reactions · 0 comments · 39 views
#cloudflare#captcha#searchengine#Cloudflare#Claude Code
⚡ TL;DR · AI summary

The author was using Cloudflare's CAPTCHA to prevent crawlers from aggressively spidering their faceted search engine. However, they found that even simple searches were triggering the challenge, which led to frustration. The author discovered a custom rule that allows the CAPTCHA to only kick in for search URLs containing at least one ampersand.

Key facts
Original article
Simon Willison's Weblog · Simon Willison
Read full at Simon Willison's Weblog →
Opening excerpt (first ~120 words) tap to expand

I'm using Cloudflare's CAPTCHA (they call it a "Web Application Firewall > Custom rules > Managed Challenge" these days) to prevent crawlers from aggresively spidering my faceted search engine on this site, but I got fed up of even simple ?q=term searches triggering the challenge. After some mucking around with Claude Code it turns out you can register the following rule instead, so the CAPTCHA only kicks in for search URLs containing at least one ampersand: (http.request.uri.path wildcard r"/search/*" and http.request.uri.query contains "&") And now /search/?q=lemur works without triggering a CAPTCHA!

Excerpt limited to ~120 words for fair-use compliance. The full article is at Simon Willison's Weblog.

Anonymous · no account needed
Share 𝕏 Facebook Reddit LinkedIn Threads WhatsApp Bluesky Mastodon Email

Discussion

0 comments