Context
Context. Analytics, tag managers and search-engine indexing belong on the live site and nowhere else, and a visible "staging" banner belongs everywhere but there. Environment names are typed by hand in the admin, so a test for the word "production" is fragile. The reliable test is structural: is this the site's primary environment, and did the request arrive on one of that environment's own hostnames? A development copy can be someone's primary environment under another hostname, which is why both halves matter.