← All headersResponse header

What is a Location header?

The URL to redirect to, or the URL of a newly created resource after a 201 Created response.

Location is what actually drives a redirect - paired with a 3xx status code, it tells the browser or client exactly where to go next, and it's also used with a 201 Created response to point at the newly created resource. Redirect chains are one of the most common silent performance and SEO problems on a website, so following Location headers end to end, not just checking the first response, is genuinely important for uptime monitoring that wants to reflect what a real visitor experiences.

Common use case

A POST to a "create order" endpoint returns 201 Created with Location pointing at the new order's URL, so the client immediately knows where to fetch or link to the resource it just created.

Example

Location: https://example.com/orders/482

History

Part of the original HTTP/1.0 specification, RFC 1945 (1996).

Did you know?

A long chain of redirects each returning their own Location is one of the most common, and most easily fixed, causes of a slow-feeling website - every hop costs a full round trip before the real content even starts loading.