Skip to content

Multiple domains & redirects

domain: takes one or more hostnames — the first is canonical, the rest serve the same app (Caddy issues a cert per hostname). redirect_from: lists domains that 301 to the canonical one instead of serving.

homeport.yaml
domain: example.com # or: [example.com, example.net]
redirect_from: [www.example.com] # www → apex, path preserved
  • redirect_from for www/canonical variants. Serving identical content on two hostnames splits your search ranking, so send one to the other.
  • Multiple domain: entries only when the app genuinely lives on several domains and each should serve.

Both lists are owned by the app — certs and redirects are created with it and removed with it, and no other app on the box can claim those hostnames.