HTTP Redirect Chain
Predict Output Medium
Question
After a 301 redirect from /old to /new, what happens?
Code
HTTP/1.1 301 Moved Permanently
Location: /new
Hint
301 means permanent redirect.
Explanation
A 301 redirect tells the browser to automatically request the new URL (/new). The browser follows the Location header and makes a new request. 301 is permanent (cached by browsers and search engines). 302 is temporary. The fetch API follows redirects by default (redirect: "follow").
Related Resources
Related Lessons
- HTTP
Learn HTTP protocol.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.