What are the Consequences for using Relative Location Headers?
- by Alan Storm
According to the spec, Location headers used in a redirect require a server name
HTTP/1.1 301 Moved Permanently
...
Location: http://example.com/foo/baz/bar
However, in 2012, most web browsers will recognize a relative path and redirect you to the new location using the original server name
HTTP/1.1 301 Moved Permanently
...
Location: /foo/baz/bar
Are there any negative/surprising consequences to using the relative URLs in the Location headers? My particular concern is how Google/search-engines will interpret this, but if there's anything else I'm not thinking about I'd love to hear it.