I have a wordpress multisite with one site to domain.com and another to materials.domain.com
At the domain site I have a page domain.com/materials
I'd like to redirect the materials.domain.com homepage to the domain.com/materials
I'm using a child theme to my subdomain instalation and trying the following on functions.php
wp_redirect(home_url('https://domain.com/materials'),301);
exit;
Now when I access the materials.domain.com the showed url is https://materials.domain.com/https://domain.com/materials/
What i'm doing wrong? How can I achieve the correct redirection?