301 redirects

Redirect old URLs to new ones with permanent 301 rules, including regex patterns with captured groups.

A site keeps a list of redirect rules, each with a source and a destination. On every visitor request the path is matched against the rules in order and the first match sends a 301 redirect. Sources are regular expressions matched against the whole path, so one rule can move a whole folder (for example /blog/(.*) to /articles/$1). Destinations are a path on the site or an https URL. Rules are managed on the Divhunt dashboard or through MCP.

How it works

  • Matching: ~^<source>$~ against '/' + request path; first match wins; HTTP 301 with Location.
  • Not applied to logged-in admins (role must be visitor) or to Studio screens.
  • Write-time validation: source max 200 characters, no ~, no back-references or lookarounds, no nested quantifiers, max 4 open-ended repeats, max 6 capture groups, must compile and pass a catastrophic-backtracking probe; destination max 2,000 characters, no spaces/control characters/backslashes, a path starting with one '/' or an https:// URL; $N references must exist in the source.
  • Admin mode allows external https hosts; MCP mode allows only the site's own hosts or an allowlist.
  • Runtime safety: low backtrack limit, at most 1,000 rules checked and a 50 ms budget per request; broken rules are skipped and logged.
  • Max 1,000 rules per site.

When to use it

  • Keep old URLs working after a migration from another builder
  • Move a whole blog folder with one regex rule

Limitations

  • Only 301 (no 302 or 410)
  • Admins are not redirected while logged in, so test in a private window
  • Rule editing is on the dashboard site, not inside the builder

Availability

  • Works in Designer and MCP.
  • Included in every plan.
  • Limits: 1,000 rules per site; source 200 characters; destination 2,000 characters; 6 capture groups

How to use it.

  1. In the builder menu, open Redirects (opens the Divhunt dashboard)
  2. Add a source path or pattern and a destination
  3. Save, then test the old URL in a private window

Questions.

Can I use wildcards?

How many rules can I have?

Related features.

No card needed

Build it today.Pay when it goes live.

Every feature is unmetered while you build. Checkout opens the first time you publish.