Random redirect: Less fragile detection of the homepage

This merges r88927-wpcom.