Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers Rewrite links

Implements a Cloudflare Worker using the HTMLRewriter API to programmatically modify URL links within HTML content.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers Rewrite links

Implements a Cloudflare Worker using the HTMLRewriter API to programmatically modify URL links within HTML content.

When To Use

Use when you need to programmatically intercept and modify URL paths within HTML responses using Cloudflare Workers.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-examples-rewrite-links-workflow-guide.mdA markdown guide demonstrating how to use the HTMLRewriter API in Cloudflare Workers to rewrite URL links within HTML content.Questions about a markdown guide demonstrating how to use the HTMLRewriter API in Cloudflare Workers to rewrite URL links within HTML...
examples/workers-examples-rewrite-links-cloudflare-workers-rewrite-links.textA JavaScript implementation of a Cloudflare Worker that uses the HTMLRewriter API to replace domain names within link attributes.Exact payloads, commands, or snippets shown in A JavaScript implementation of a Cloudflare Worker that uses the HTMLRewriter API to replace domain names within link...
examples/workers-examples-rewrite-links-cloudflare-workers-rewrite-links-javascri.textA JavaScript implementation of a Cloudflare Worker that uses the HTMLRewriter API to replace specific domain links in HTML responses.Exact payloads, commands, or snippets shown in A JavaScript implementation of a Cloudflare Worker that uses the HTMLRewriter API to replace specific domain links in...
examples/workers-examples-rewrite-links-cloudflare-workers-python-htmlrewriter-li.textA Python implementation using HTMLRewriter to intercept and modify URL attributes within HTML elements.Exact payloads, commands, or snippets shown in A Python implementation using HTMLRewriter to intercept and modify URL attributes within HTML elements.
examples/workers-examples-rewrite-links-cloudflare-workers-hono-rewrite-links.textA Hono-based Cloudflare Worker example that uses an AttributeRewriter class to replace domain names within HTML attributes.Exact payloads, commands, or snippets shown in A Hono-based Cloudflare Worker example that uses an AttributeRewriter class to replace domain names within HTML attri...

What This Skill Covers

  • Rewrite URL links in HTML using the HTMLRewriter. This is useful for JAMstack websites.
  • Main sections: Tags.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://developers.cloudflare.com/workers/examples/rewrite-links