Multisite redirect loop for a single www domain

It’s likely down to an nginx configuration if your server runs nginx.

For example, an nginx default config could contain:-

if ($host ~* ^www.domain.co.uk) {
    rewrite ^(.*)$ https://domain.co.uk$1 permanent;
}

This would result in your server trying to set a 301 redirect from www to non www but then when www is defined in WordPress, the server tries to redirect back to non www causing an infinite redirect loop.

We’ve recently experienced this with a WordPress website and exhausted every possible route on the WordPress side as it sounds that you have done subsequently coming across the nginx config at domain level on the server.