Varnish: don't mobile redirect www.$project.org

URLs such as www.wikivoyage.org/wiki/Article redirect to
en.wikivoyage.org. The issue is not Wikivoyage-specific projects as it
happens with e.g. www.wikipedia.org too. However, www.wikivoyage.org
links are still in old web references & search engine indexes, so it
makes matters especially worse for Wikivoyage.

The problem is the mobile redirector runs before these redirects take
place, and redirects to www.m, which NXDOMAINs and users get error
pages.

Fix this by excluding "www" from the mobile redirect.

Bug: 48318
Change-Id: Ie9147de410a51e3bd3d3597e27b00ccee4f9f236
varnish: simplify the mobile redirect regexp

Now that we don't have to maintain squid redirector compatibility,
rewrite the huge, almost unreadable, mobile redirect regexp in three
distinct, easier to maintain redirects.

This was done with efficiency in mind and avoids checking for the same
match twice. The three redirects are likely to be slower than one, but
this is hopefully offset by not checking for e.g. "wikimedia" three
times. Plus, the regsubs are within the multiple-clause UA/cookie/url
guard, so it only does matter for a small minority of hits.

Change-Id: Iebfbc46d1a6a878d5c0dddd74ac44b8f2a8cda82
Merge "Varnish: don't mobile redirect www.$project.org" into production
Merge "varnish: simplify the mobile redirect regexp" into production