HTTP

HTTP 307 Temporary Redirect vs 308 Permanent Redirect

Both HTTP 307 (Temporary Redirect) and 308 (Permanent Redirect) belong to the 3xx Redirection category. 307 indicates that the resource temporarily resides at a different URL. Unlike 302, this guarantees the HTTP method will NOT be changed. Meanwhile, 308 means that the resource has been permanently moved. Like 301, but guarantees the HTTP method will NOT be changed.

Description

The resource temporarily resides at a different URL. Unlike 302, this guarantees the HTTP method will NOT be changed.

When You See It

When you need a temporary redirect that preserves the request method (POST stays POST).

How to Fix

Follow the Location header using the same HTTP method.

Description

The resource has been permanently moved. Like 301, but guarantees the HTTP method will NOT be changed.

When You See It

For permanent URL changes where POST requests must remain POST.

How to Fix

Update all references to the new URL. The HTTP method is preserved.

Key Differences

1.

HTTP 307: The resource temporarily resides at a different URL. Unlike 302, this guarantees the HTTP method will NOT be changed.

2.

HTTP 308: The resource has been permanently moved. Like 301, but guarantees the HTTP method will NOT be changed.

3.

You encounter 307 when when you need a temporary redirect that preserves the request method (POST stays POST).

4.

You encounter 308 when for permanent URL changes where POST requests must remain POST.

When to Use Which

For 307 (Temporary Redirect): Follow the Location header using the same HTTP method. For 308 (Permanent Redirect): Update all references to the new URL. The HTTP method is preserved.

Learn More