Interview Prep/Networking/HTTP, TLS & Certificates

What is the difference between 301, 302, 307 and 308 redirects?

IntermediateConceptHTTP, TLS & Certificates
Answer

301 and 308 are permanent; 302 and 307 are temporary. 307 and 308 preserve the request method and body, while historically 301 and 302 let clients switch POST to GET.

For SEO and caching, use 301/308 for permanent moves; for HTTP to HTTPS redirects 301 or 308 is standard, and 308 is safer for APIs.

All Networking questions Roadmap: Networking for DevOps

More on HTTP, TLS & Certificates