Cannot use Network Admin (Dashboard) on Multi-site after 301 www redirect

You do not need to change the functions.php for this. You need to add both options for the domain in the domain mapping and set the one with www. as default.

tech