What are the Consequences for using Relative Location Headers?

Posted by Alan Storm on Pro Webmasters See other posts from Pro Webmasters or by Alan Storm
Published on 2012-06-23T18:07:48Z Indexed on 2012/06/23 21:25 UTC
Read the original article Hit count: 264

Filed under:
|
|

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.

© Pro Webmasters or respective owner

Related posts about seo

Related posts about redirects