Skip to content

Redirections

X4Applegate edited this page Sep 10, 2026 · 1 revision

Redirections

A redirection sends visitors from one hostname to another with a proper HTTP status code, for example old.example.com → new.example.com. Redirections get their own TLS certificate from Caddy just like proxy hosts, so the old name keeps working over HTTPS.

Create menu → Redirection or Redirections → New.

Status codes

Code Use it for
301 Moved Permanently Permanent domain moves. Browsers and search engines cache it indefinitely.
302 Found Temporary redirects that may change. Not cached.
307 Temporary Redirect Like 302 but preserves the request method (POST stays POST). Safer for APIs.
308 Permanent Redirect Like 301 but preserves the method.

Fields

  • Domains — one or more hostnames to redirect. A wildcard entry captures every subdomain when Wildcard subdomain is on.
  • Forward scheme and domain — where visitors go.
  • Preserve path — keeps the URL path: old.com/blog/post → new.com/blog/post. Off always lands visitors on the root. Strip path prefix removes a leading segment first.
  • Path rules — a table of per-path redirects with their own code and destination, for one-off moves inside the same host.
  • Sunset date — after this date the redirection answers 410 Gone instead, the right signal once a move is complete.
  • Force canonical HTTPS — redirect HTTP to HTTPS first.
  • HSTS — max-age, include subdomains, preload.
  • Custom response headers, access list, IP blocklist — the same access-control tools proxy hosts have.
  • Maintenance mode — a branded maintenance page with a custom message, status code and optional redirect while you work.
  • Managed DNS — choose a provider profile and zone and CaddyUI creates the A records for every hostname on save and deletes them when the row is removed. Per-hostname pre-flight shows which records will be created and which already exist. See DNS Providers.
  • Certificate — Auto (Let's Encrypt / ZeroSSL) or a custom certificate. Auto reuses a covering managed wildcard automatically.
  • Also deploy to — create the same redirection on other Caddy Fleet servers. See Caddy Fleet.
  • Advanced config, tags, notes, colour, owner.

Validation

Since v2.42.1 a redirection Caddy would refuse is rejected at save time with a plain explanation. A sync that fails later shows an amber banner on every page with the error and Retry sync now.

Bulk actions

The list page supports multi-select with Enable / Disable / Delete, drag-to-reorder, clone, and the ⌘K / Ctrl+K command palette finds redirections by name.

Clone this wiki locally