

How The Guardian successfully moved its domain to theguardian.com - malditojavi
http://www.theguardian.com/info/developer-blog/2014/feb/18/how-the-guardian-successfully-moved-domain

======
lawl
The only clever thing they did was this:

> _the Identity team started laying cookies on www.theguardian.com in advance.
> This was a nice touch because it meant that visitors would still be logged
> into the site when we eventually changed domain._

Everything else? Yeah uhm, not very interesting. As they wrote themselves,
there's a thing called 301 - permanently moved.

~~~
sopooneo
I read that and understood how it would be beneficial, but not how it would be
_possible_. Say I own x.com, and y.com and even have them both being served
from the same box. If a user requests a page for x.com, how can I get them to
accept a cookie for y.com?

~~~
jules
On the old domain, make a request to the new domain with query parameters that
have the information necessary to login as that user. You can do this using
e.g. a hidden image, an iframe, or using javascript. The request on the new
domain saves that login information in a cookie.

~~~
sopooneo
Of course. I should have thought of that. Thank you.

------
nodata
> We attempted to speak with all our major referrers including search engines
> and social media.

Reworded: "Google don't have a phone".

~~~
room271
They do for large organisations like The Guardian.

~~~
drpgq
I wonder how large you have to be before Google will answer.

~~~
spada
Spend > $250k/month on adwords and you can be friends with Google.

------
cowchase
I'm surprised they went live with this without an expiration date on their
permanent redirects. Now there's no way back, even if anything breaks. Looks
like an unintentional Big Bang launch to me.

[http://getluky.net/2010/12/14/301-redirects-cannot-be-
undon/](http://getluky.net/2010/12/14/301-redirects-cannot-be-undon/)
[http://mark.koli.ch/set-cache-control-and-expires-headers-
on...](http://mark.koli.ch/set-cache-control-and-expires-headers-on-a-
redirect-with-mod-rewrite)

------
eponeponepon
The Graun's address will forever be www.grauniad.co.uk to me.

(note to confused and/or non-UK people: look up the magazine Private Eye)

~~~
josephlord
And even if you are familiar with Private Eye you might not get the joke that
the Guardian was in the past notorious for tpyos and misprinst.

~~~
syncsynchalt
I had always heard an interesting story about that — since the newspaper was
printed in Manchester, it was the first press runs that had to be sent to far-
off London. Then the later runs (with misspellings often fixed) were sent to
the closer cities.

On the other hand, newspapers based in London would send their typo-ridden
newspapers to far-off locales first, and the corrected editions would stay in
London.

Since the tastemakers were in London this resulted in a situation where the
newspaper becomes notorious for being ridden with errors.

No idea if there's any truth to it, the wikip page presents a different story
that sounds like problems with collaboration tools (eg. TTY) used between the
two cities.

------
nhangen
Not a very helpful article. I was hoping they'd share how they managed the SEO
portion in a way that would prevent a drop in rankings. They glossed over
almost every point.

------
lukasm
They need to talk to Sean Parker. He'll convince them to drop "the"

~~~
room271
Ha, the issue there is really about domain availability and cost.

------
ChrisArchitect
in previous years say 5+ years ago, this was a scary concept to anyone working
on sites and still believing in nonexisitent SEO voodoo. But it has become
commonplace and more than simple to 301 a site from one domain to another,
updating the usual suspects like google etc to make sure it all goes smoothly.
So nothing really that super here. Just nice to hear about process behind the
scenes and that everything was taken into account etc..as it should be.

~~~
mhoad
I am not sure how many domain migrations you have done in the past but based
on this comment my guess would be few if any. There is a bit more to it than
just slapping on a couple of 301's and hoping for the best.

~~~
ChrisArchitect
have done many, obviously there's a lot of legwork with links and content, but
it's not some technically groundbreaking thing or mass-mystery like it used to
be. Maybe I've just gotten used to it.

------
jakub_g
Random related trivia: `gu.com` also redirects to `theguardian.com` (useful on
mobile, way faster to type).

------
macspoofing
>Our goal was simple: “to serve all desktop and mobile traffic on
www.theguardian.com and no longer serve any content on www.guardian.co.uk,
m.guardian.co.uk or www.guardiannews.com"

Great!

So is the consensus that .mobi was one of the worst ideas in existence?

~~~
rhizome
Once upon a time it was thought that device TLDs would be a useful thing,
that's all. It just so happened that the smartphone was invented in the
interim, and media queries and responsiveness and, heck, HTML became the
standard way of representing mobile content.

------
paromi
their first byte is not that fast :

[http://www.webpagetest.org/result/140218_ZP_PHQ/](http://www.webpagetest.org/result/140218_ZP_PHQ/)

also many requests on the page

~~~
mattpointblank
Try comparing that against the new responsive version of the site:
[http://www.webpagetest.org/result/140218_42_RAG/](http://www.webpagetest.org/result/140218_42_RAG/)

~~~
paromi
you have tested the mobile version

------
MichaelTieso
Interesting that they contacted Yoast for SEO advice.

~~~
bhousel
I was wondering about this too. The Guardian can't possibly run their site on
Wordpress, or can they?

~~~
mattpointblank
No, it's all internal, but that guy knows his stuff when it comes to SEO in
general.

------
napcae
> _If the host was www.theguardian.com, we would rewrite all the URLs on the
> site to be www.theguardian.com. If the Host was www.guardian.co.uk we would
> rewrite all the URLs on the site to be www.guardian.co.uk._

wat?

~~~
peroo
They couldn't change all URLs to be relative, so instead they wrote a filter
which would rewrite absolute URLs to match the selected hostname. A simple fix
for a relatively complex problem.

~~~
VBprogrammer
Or a hack which will never be removed from the code-base, depending on your
point of view.

I'm intrigued as to why changing to relative domains wasn't possible. If
nothing else pushing
'[http://www.theguardian.com'](http://www.theguardian.com') out for every link
adds to a lot of bytes up for a busy site.

~~~
cbr

        pushing 'http://www.theguardian.com' out for every link
        adds to a lot of bytes up for a busy site
    

Fewer than you'd think after gzip compression:

    
    
        $ curl -s http://www.theguardian.com/us | wc -c
        223195
        $ curl -s http://www.theguardian.com/us | \
           sed s'~http://www.theguardian.com~~' | wc -c
        215473
        $ curl -s http://www.theguardian.com/us | \
           gzip | wc -c
        33783
        $ curl -s http://www.theguardian.com/us | \
           sed s'~http://www.theguardian.com~~' | gzip | wc -c
        33554
    

They have 7.7k of extra html due to repeating
"[http://www.theguardian.com"](http://www.theguardian.com") for every link,
but gzip compressed this is only a difference of 229 bytes.

------
im3w1l
Very nice writeup. What was the reason for switching?

~~~
grey-area
They want to move from a local newspaper to a global news website.

