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.
Related Posts:
- WordPress Multisite – Multiple subfolders for blogs
- WordPress multisite subdirectory redirect infinite loop issue
- multisite htaccess 301 redirects
- W3 Total Cache Plugin with WP 3 MultiUser [closed]
- Domain redirect in WordPress multisite
- Why wordpress multisite redirect to wp-signup if site exists?
- Sub-subdomain getting redirected to main domain
- How to exclude a directory from WordPress permalinks in a Multisite environment?
- How to disable the default WordPress redirect to non-www URLs?
- Redirect subdomain in Multisite installation?
- Issue with htaccess redirection in WP Multisite
- Redirect only posts to New Domain
- Multisite setup help – plain domain/subsite always redirects to domain with subdir multisite
- Temp URL Redirect Loop
- Wrong Redirect/Rewrite Rules?
- Htaccess file isn’t redirecting http sub-pages to https––they display 404 error instead, tried many solutions and none work
- URL without www redirect directly with submission page – Multiwordpress install
- Multisite Redirection to new domains
- Redirect old uploads after moving to multisite
- WordPress: how to change URL for individual MultiSites?
- Multisite Subdomain Redirect Mask
- Working with Reverse Proxies and Multisite Installation
- multisite 404 subfolder same name slug as site
- How to make the redirects right? IP to domain name folders
- Redirect extra url to Multisite in folder
- External rewrite rules missing in htaccess – Multisite
- Site Redirecting to wp-signup.php
- Moving a WP Multisite to a subdirectory
- Why is WordPress Multisite redirecting to wp-signup.php and how to fix it?
- multisite 404 error for subdirectory
- Multisite htaccess on localhost with WP as an SVN external?
- WP-Admin not working properly at WordPress multisite with subdirectories
- Multisite Subdomains result in 403 Forbidden
- Multisite: Develop locally using production images with .htaccess
- Multisite 404 errors and non-www redirecting to home page
- How to prevent hotlinking with htaccess in WordPress and why most common use about it doesn’t work?
- Error 101 after upgrading WordPress
- Redirect all users, except network administrators, from the main site to a subsite
- Multisite non-www domain redirects to sign-up
- WordPress network (multisite) /wp-admin/ redirect loop (ERR_TOO_MANY_REDIRECTS)
- Suppress subdirectory from WordPress Multisite primary URL
- Multisite non www domain gives registration error but should redirect to www.domain.com
- 301 Redirects for posts, category, pages from original domain to sub-domain of multisite
- Redirect loop (only for multisite network admin)
- WordPress Multisite Login Access
- WordPress multisite htaccess
- wordpress htaccess is hijacking my .mp4 files
- WordPress mutisite migration
- Redirect users on logout
- Multisite, multiple domains per site
- Multisite Network menu links not updating
- Create rewriterules for different domains in htaccess file with WP multisite
- WordPress multisite in subdirectory, not root, and remove base folder from url
- Auto Redirect after login
- Site kit Google Analytics setup giving Error: {“error”:”invalid ‘redirect_uri'”}
- All pages have 302 redirect, which I can’t remove
- Multsite redirecting to the main site
- add_rewrite_rule on multisite doesn’t work
- Redirect & permalink problems after moving multisite to a new server
- Error uploading files bigger than 58 MB
- How to configure Multisite Network with randomized hostnames?
- WordPress Multi-Site on Ubuntu 18.04 LAMP Keeps Re-Directing
- Some PDF files get Forbidden Access and other open normally on the same directory subsites
- htaccess file for multiple CMS’s (multisite wordpress + wolfcms) on same domain but different subdirectories
- WordPress multisite .htaccess causes 500 error on old *.php URLs
- Redirect One Multisite to Another
- Site redirecting to http://example.com/wp-signup.php?new=example.com
- 301’s not working with multisite
- Redirect to localhost after installing Multisite on server
- How to protect specific uploaded files from being accessed by non-logged-in users in WP-multisite
- Multisite install w/ Sub domains on a subdomain
- Hosting 2 WordPress websites in /public_html/ & /public_html/subdirectory/ at the same time
- How to temporarily redirect front page of a network to one of the sites/blogs?
- How to Deny Access to No Referrer Requests on Multiste with Mapped domains
- WordPress Multisite and how to apply sef urls only to specific sites
- How many .htaccess files should a WordPress multisite (subdirectory set up) have?
- How to fix redirection of Post/Page of wordpress inside the wordpress?
- Multisite htaccess file causing segfault (Segmentation fault 11)
- After switch domain, some parts of my site still point to my old domain
- Multisite network admin login redirect
- Multisite wp-admin redirecting to main wp-admin using NGINX
- Multisite htaccess with domain rewrites
- Multisite (with nested paths) wp-admin redirect loop
- Multisite WordPress Configurtion
- How To Change the URL of a WordPress Multisite
- Multisite, different domains, optional subdirectory, and htaccess
- Multisite: Redirect Subsite Administrator to Subsite Home Page, Bypassing Dashboard
- Admin user getting redirected to /wp-admin/user
- Make a select where the options are the different multisites
- Is there a way to have wordpress 301 versus 302 urls by default?
- Development (multi)site indexed – recommendations to redirect 301 to correct url?
- Nginx Multisite redirects (incorrectly) on Chrome IE and Mobile, but works (correctly) on Firefox
- Permalinks in Multisite not working
- WordPress 3.0 Multisite – Child sites and backends appearing blank
- Subdomain add comment redirect to 404 not found page iis server
- 404 error in dashboard of subdomain of multisite
- Multisite Primary Domain Broken All Subsites Work
- Make multisite non-existing subdomains go to homepage instead of Index of/ page
- Wp-admin wrongly redirecting on multisite
- Show 404 when someone visits a non-existant Multisite site