You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I find the current documentation for the redir directive slightly confusing.
It describes the HTTP status code 302 as temporary redirect. This is correct but the full status code is 302 Found and there is another status code 307 Temporary Redirect. In my opinion, those two can be easily confused with the current documentation.
Additionally, 308 Permanent Redirect is not mentioned although I would argue that it is often more appropriate than 301, for example for manual HTTP to HTTPS redirects.
I hope that my modifications improve the documentation in those regards.
Yeah we have some open discussions about this (see caddyserver/caddy#7348 and related issues) about possibly changing the default and possibly adding new named mappings to the status codes, but it hasn't gone anywhere yet.
Yeah we have some open discussions about this (see caddyserver/caddy#7348 and related issues) about possibly changing the default and possibly adding new named mappings to the status codes, but it hasn't gone anywhere yet.
I agree with Matt's opinion from the linked issue and do not want to changed the named status codes as that would probably break many existing setups.
However, I still think that the documentation could be a little bit more clear, hence this PR :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I find the current documentation for the
redirdirective slightly confusing.It describes the HTTP status code 302 as temporary redirect. This is correct but the full status code is
302 Foundand there is another status code307 Temporary Redirect. In my opinion, those two can be easily confused with the current documentation.Additionally,
308 Permanent Redirectis not mentioned although I would argue that it is often more appropriate than 301, for example for manual HTTP to HTTPS redirects.I hope that my modifications improve the documentation in those regards.