HTTP 301 Moved Permanently vs 415 Unsupported Media Type
HTTP 301 (Moved Permanently) is a 3xx Redirection response, while 415 (Unsupported Media Type) is a 4xx Client Error response. 301 indicates that 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. In contrast, 415 means that the server refuses to accept the request because the Content-Type is not supported.
Description
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.
When You See It
After domain migrations, URL restructuring, or when consolidating duplicate URLs.
How to Fix
Update links and bookmarks to the new URL in the Location header. For SEO, this is the preferred redirect for permanent moves.
Description
The server refuses to accept the request because the Content-Type is not supported.
When You See It
When sending JSON to an endpoint that only accepts XML, or missing the Content-Type header.
How to Fix
Set the correct Content-Type header matching the data format you're sending.
Key Differences
301 is a 3xx Redirection response, while 415 is a 4xx Client Error response.
HTTP 301: 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.
HTTP 415: The server refuses to accept the request because the Content-Type is not supported.
You encounter 301 when after domain migrations, URL restructuring, or when consolidating duplicate URLs.
You encounter 415 when when sending JSON to an endpoint that only accepts XML, or missing the Content-Type header.
When to Use Which
For 301 (Moved Permanently): Update links and bookmarks to the new URL in the Location header. For SEO, this is the preferred redirect for permanent moves. For 415 (Unsupported Media Type): Set the correct Content-Type header matching the data format you're sending.