Inside index.php I used wp_safe_redirect
to redirect users to the main global page if users write a false url.
I have 1 domain and three subdomains. These subdomains refer to php files and not to child themes or multisite.
$Subexplode = explode('.', $_SERVER['HTTP_HOST']);
$SubName = array_shift($Subexplode);
$A = 'domainname';
$B = 'subdomain1';
$V = 'subdomain2';
$H = 'subdomain3';
if($SubName === $B || $SubName === $V || $SubName === $H){
$redirectUrl = '/reception';
if(is_home()){
header_remove();
wp_safe_redirect($redirectUrl);
exit;
}
}
WordPress auto php analyse refuse, inside theme files editors, from Tuesday 10 Jan to validate php file with fatal error : "Unable to send a message to the site to check for fatal errors."
wp_safe_redirect('/')
is the only function/line that interrupt wordpress analyse and validation file during update theme files.
is_home()
, despite its name, only works with the blog page, so you have to useis_front_page()
if you've set a static homepage.