Intern Track Roadmap

HTTP status codes: redirection (3xx)

This course covers the HTTP 3xx status codes and how each one behaves. It starts with the Location header, the two-request redirect flow, and the problems of redirect chains and loops. It then explains 301 and 302, their caching and SEO effects, and why browsers may change POST to GET. Other lessons cover 303 See Other with the Post-Redirect-Get pattern, 304 Not Modified with ETags and Last-Modified, and the method-preserving 307 and 308. The last lesson applies all of this in Rails controllers and routes.

What you'll learn

  • ✓How a 3xx response and the Location header direct the client
  • ✓Temporary versus permanent redirects and their caching and SEO effects
  • ✓The Post-Redirect-Get pattern with 303 See Other and flash messages
  • ✓Conditional requests with ETag, Last-Modified and 304 Not Modified
  • ✓When 307 and 308 preserve the HTTP method and body
  • ✓Redirects, stale? and open-redirect protection in Rails
Free preview · Lesson 1 5 min read

What are redirection status codes?

Imagine you drive to your favorite restaurant, but there's a sign on the door: "We moved to 123 Main Street." You don't give up: you just follow the new address. That's what a 3xx redirection does on the web.

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...