From 036083d67eeeb60f67501618073793efcbaca9cf Mon Sep 17 00:00:00 2001 From: Felix Auringer Date: Sat, 9 May 2026 17:00:52 +0200 Subject: [PATCH] docs: clarify description for redir directive --- src/docs/markdown/caddyfile/directives/redir.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/docs/markdown/caddyfile/directives/redir.md b/src/docs/markdown/caddyfile/directives/redir.md index 6b086836..3e874f92 100644 --- a/src/docs/markdown/caddyfile/directives/redir.md +++ b/src/docs/markdown/caddyfile/directives/redir.md @@ -21,15 +21,19 @@ redir [] [] - A positive integer in the `3xx` range, or `401` - - `temporary` for a temporary redirect (`302`, this is the default) + - `temporary` for a temporary redirect (`302 Found`, this is the default) - - `permanent` for a permanent redirect (`301`) + - `permanent` for a permanent redirect (`301 Moved Permanently`) - `html` to use an HTML document to perform the redirect (useful for redirecting browsers but not API clients) - A placeholder with a status code value +Note that both `temporary` and `permanent` allow the user agent to change the method (e.g. from `POST` to `GET`). +The status codes `307 Temporary Redirect` and `308 Permanent Redirect` should be used if the method must be the same in the second request. +Caddy uses `308` as the status code in its automatic HTTP to HTTPS redirects. + ## Examples