Redirects Tools
Redirects are built into the static site as a Cloudflare Pages _redirects file. They’re 301 permanent redirects by default.
create_redirect
Section titled “create_redirect”Creates a redirect from one path to another.
create_redirect from_path="/about" to_path="/om-oss"create_redirect from_path="/services.html" to_path="/tjanster"The AI agent uses redirects automatically after:
- WordPress or URL migrations (old paths → new slugs)
- Page slug changes (the old path needs to redirect to the new one)
Wildcards — retire a whole family of URLs
Section titled “Wildcards — retire a whole family of URLs”A migrated site’s dead URLs come in shapes, not as individuals. One rule can cover all of them:
create_redirect from_path="/category/*" to_path="/blogg/:splat"- A trailing
*matches everything under the prefix (and the prefix itself);:splatinserts what was captured. :namematches exactly one segment:from_path="/blog/:slug"→to_path="/artiklar/:slug".- Narrower rules always win, so
/blogg/recept/*can sit alongside/blogg/*.
Typical after a WordPress move:
| Old shape | Rule |
|---|---|
/category/… archives |
/category/* → /blogg/:splat |
/tag/… archives |
/tag/* → /blogg |
/author/… archives |
/author/* → /om-oss |
| Date permalinks | /2019/* → /blogg/:splat |
Three things Typeroll will refuse, and why:
- A
*anywhere but the end. Cloudflare ignores it, so the rule would look saved and do nothing. - A rule that would hide a live page. Redirects are applied before files are served, so
/blogg/*would make every real article under/blogg/unreachable. Narrow the prefix instead. - Query strings. Redirects match the path only — an old
/?p=123URL has nothing to key on.
list_redirects
Section titled “list_redirects”Returns all configured redirects.
delete_redirect
Section titled “delete_redirect”Deletes a redirect by its from-path.
After a slug change
Section titled “After a slug change”If you rename a page’s slug, always create a redirect:
Rename the "services" page to "what-we-do" and set up a redirect from /services.The AI agent handles both steps automatically when you phrase it this way.
Redirect limits
Section titled “Redirect limits”Cloudflare Pages supports up to 2,100 redirects per site. For large migrations, the AI agent prioritises the most-trafficked URLs first.