# HTTP 307 Temporary Redirect — Status Code Meaning & Examples

> A temporary redirect where the client must repeat the exact same request — method and body — at the new URL.

307 is a 302 without the ambiguity: the client must resend the same method and body to the `Location` URL, so a POST stays a POST. That makes it the safe temporary redirect for APIs and form endpoints.

Browsers also show an internal 307 when HSTS upgrades an `http://` URL to `https://` before the request ever leaves the machine.

- Class: 3xx Redirection
- Retry: Not applicable
- Cacheable by default: no
- Defined in: [RFC 9110 §15.4.8 — 307 Temporary Redirect](https://www.rfc-editor.org/rfc/rfc9110.html#section-15.4.8)

## Example response

```http
HTTP/1.1 307 Temporary Redirect
Location: https://api.example.com/v2/orders
```

## When you'll see it

- Temporary moves of API endpoints.
- HSTS upgrades, which Chrome DevTools labels '307 Internal Redirect'.
- Next.js `redirect()` and non-permanent `redirects` in next.config respond with 307.

## How to use it well

1. Use 307 instead of 302 whenever the method must be preserved.
2. For a permanent move with the same guarantee, use 308.
3. A '307 Internal Redirect' in DevTools is HSTS, not your server — there's nothing to fix.

## Send a 307 from your server

### Express

```
res.redirect(307, "https://api.example.com/v2/orders");
```

### Next.js route handler

```
return NextResponse.redirect(new URL("https://api.example.com/v2/orders", request.url), 307);
```

### Flask

```
return redirect("https://api.example.com/v2/orders", code=307)
```

### Go net/http

```
http.Redirect(w, r, "https://api.example.com/v2/orders", http.StatusTemporaryRedirect)
```

### nginx

```
return 307 https://api.example.com/v2/orders;
```

## FAQ

### What does '307 Internal Redirect' mean in Chrome?

The site sent a Strict-Transport-Security header earlier, or is on the HSTS preload list, so Chrome rewrote http:// to https:// locally. No request reached the server.

### 307 vs 302?

Same meaning — temporary — but 307 forbids changing the method. With a 302, browsers turn a POST into a GET.

## Related status codes

- [302 Found](https://www.devkult.com/http/302.md)
- [308 Permanent Redirect](https://www.devkult.com/http/308.md)
- [303 See Other](https://www.devkult.com/http/303.md)

Open the interactive page: https://www.devkult.com/http/307