gandi-cli

β†ͺ️ Redirects

Manage web redirections (web forwarding) for a domain.

The gandi redirect group manages web redirections (web forwarding) β€” rules that forward a hostname to another URL. They share the same scope as DNS, so a domain:tech token covers them.

πŸ“‹ List redirects

Show every web redirect configured for a domain:

gandi redirect list example.com

βž• Add a redirect

Forward a source host to a target URL. The --type flag controls how the redirect behaves:

gandi redirect add example.com www https://example.org
gandi redirect add example.com shop https://shop.example.org --type http302
--typeBehaviour
http301Permanent redirect (default) β€” browsers and search engines cache it
http302Temporary redirect β€” not cached
cloakFrame the target so the original URL stays in the address bar

πŸ—‘οΈ Delete a redirect

Remove the redirect on a source host. This asks for confirmation β€” pass --yes to skip the prompt:

gandi redirect delete example.com www --yes

Requires: the Manage technical configuration (domain:tech) permission on your token (the same one used for DNS).

πŸ“– Command reference

CommandDescription
gandi redirect list <domain>List web redirects
gandi redirect add <domain> <source> <target> --type <type>Add a web redirect
gandi redirect delete <domain> <source> --yesDelete a redirect (skip prompt)