Redirect-By HTTP headers

One of the things one runs into when you’re doing large migrations (between domains, or within a domain) is that you run into redirects that go “wrong”. A system somewhere is doing a redirect, and you don’t know which system you need to change that redirect in. A “Redirect-By” header helps you find out which system did the redirect.

Origin story

I ran into this problem while doing the migration of the Guardian from guardian .co.uk to the theguardian .com. Multiple systems were doing redirects, making it hard to find the source. So, I came up with the X-Redirect-By header, this header was sent along with each redirect. This helped me identify which system was doing the redirect.

In 2017 I wrote this blog post on Yoast.com to propose the X-Redirect-By header. We then implemented that, first in Yoast SEO, later on also in WordPress, and other systems like Typo3 followed suit.

Usage of x-redirect-by

Currently, a large portion of sites in the world uses the X-Redirect-By header to indicate which system created a redirect. The Wikipedia page about HTTP headers lists it as a “Common non-standard response field”.

Should we standardize redirect-by?

As I was preparing my presentation for SMX Munich next week, where I’ll be presenting “The missing guide to SEO domain migrations”, I was discussing this with John Mueller. He kindly informed me that x- prefixed headers are actually discouraged. In fact, Google has been trying this for x-robots-tag, see this IETF draft.

Which got me thinking: should we take the next step, and standardize this properly? I’ve been going over the existing standard HTTP headers, and while I think that you could use Via or Server headers for this same purpose, it’s not the same. A proposal for an official Redirect-By header would have the benefit of getting more people to notice it and probably implement it, which would potentially help every SEO and web developer. Lots of them have told me they have spent many hours finding the source of a redirect.

I’d love feedback on this. What do you think? Should we standardize this as redirect-by? Am I missing an obvious, already existing, standard header that could be used for this? Let me know in the comments!

A headshot of Joost de Valk, author.

Joost de Valk

Joost is an internet entrepreneur from Wijchen, the Netherlands. He is an investor at Emilia Capital and actively working on Progress Planner. He's also the founder of Yoast. Joost is married to Marieke, who is also Yoast's former CEO. Marieke and Joost have 4 kids together.

»

Search Opinion » Redirect-By HTTP headers

3 thoughts on “Redirect-By HTTP headers”

  1. Or, even more generically perhaps, just something that identifies which ‘thing’ (at a more specific level than ‘server’) was responsible for the response – including non-redirect outcomes, etc.

    Reply
  2. I love this header! I didn’t knew its origin story, though. I saved me a lo of trouble more than once. Having this as a “standard” would be great, so other software setting a redirect are more likely to use it.

    Reply
  3. The way I understand that MDN article is that the “x-” prefix is discouraged now, but there’s no point in changing every instance of “x-” headers to drop the prefix. You’ll just end up with a mix of “X-Redirect-By” and “Redirect-By” header for decades to come. I’d just stick with the “X-” for this particular header. But if you’re adding some new headers for something, then you can obviously omit it.

    Reply

Leave a Comment