HTTP 301 Moved Permanently vs 307 Temporary Redirect
301 and 307 differ in both permanence and method handling. A 301 is permanent and may change the HTTP method, while a 307 is temporary and always preserves the method. Choosing between them depends on whether the move is permanent and whether the method matters.
Descripción
The resource has been permanently moved to a new URL. All future requests should use the new URL. Search engines will transfer link equity to the new URL.
Cuándo lo verás
After domain migrations, URL restructuring, or when consolidating duplicate URLs.
Cómo solucionarlo
Update links and bookmarks to the new URL in the Location header. For SEO, this is the preferred redirect for permanent moves.
Descripción
The resource temporarily resides at a different URL. Unlike 302, this guarantees the HTTP method will NOT be changed.
Cuándo lo verás
When you need a temporary redirect that preserves the request method (POST stays POST).
Cómo solucionarlo
Follow the Location header using the same HTTP method.
Diferencias clave
301 is permanent — search engines transfer link equity and browsers cache the redirect.
307 is temporary — the original URL retains its search ranking.
301 may rewrite POST to GET; 307 always preserves the original HTTP method.
301 is the most common redirect for URL migrations; 307 is used for temporary rerouting.
For a permanent method-preserving redirect, use 308 instead of either.
Cuándo usar cuál
Use 301 when a page has permanently moved and you only serve GET requests. Use 307 when the redirect is temporary and you need to preserve the HTTP method (e.g., redirecting a POST request during maintenance). If you need both permanent and method-preserving, use 308.