Awesome referer hack

I was talking to Roy Leban the other day about how a particular domain registrar of his makes it check-box trivial to redirect from a naked domain (say to, but doesn’t do anything whatsoever to redirect from to I was teasing him about needing to get a real domain registrar, but it turns out he has a really slick hack to manage the redirect on the side (which happens to be hosted on Google App Engine) since App Engine isn’t cool with naked domains.

What he does is this:

  1. checks the box on his domain registrar to forward from* to
  2. once the user’s web browser arrive at, he checks the HTTP Referer1 header to see if the user came from, and, if so,
  3. redirects the user one more time to based on the Referer (in this case

I’m not sure that solution would have ever occurred to me, but I love it for the hack value.

  1. Merriam-Webster says that should be spelled “Referrer”, but RFC 2068 codified the misspelling “Referer” as the actual header name way too long ago to fix. []

Post a Comment

Your email is never shared. Required fields are marked *