Index: src/wp-includes/ms-settings.php
===================================================================
--- src/wp-includes/ms-settings.php	(revision 28174)
+++ src/wp-includes/ms-settings.php	(working copy)
@@ -35,6 +35,12 @@
 		$_SERVER['HTTP_HOST'] = substr( $_SERVER['HTTP_HOST'], 0, -4 );
 	}
 
+	// www is an illegal subdomain in multisite. If it exists in the requested URL,
+	// we strip it so that template_redirect initiates the proper 301
+	if ( is_subdomain_install() && substr( $domain, 0, 4 ) == 'www.' ) {
+		$domain = substr( $domain, 4 );
+	}
+
 	$path = strtolower( stripslashes( $_SERVER['REQUEST_URI'] ) );
 	if ( is_admin() ) {
 		$path = preg_replace( '#(.*)/wp-admin/.*#', '$1/', $path );
