Remove index.php references
This commit is contained in:
@ -186,7 +186,7 @@ function alt_links(): void
|
||||
continue;
|
||||
}
|
||||
$canonical_query['lang'] = $lang;
|
||||
$link = CANONICAL_URL . $_SERVER['SCRIPT_NAME'] . '?' . http_build_query($canonical_query);
|
||||
$link = CANONICAL_URL . ($_SERVER['SCRIPT_NAME'] === '/index.php' ? '/' : $_SERVER['SCRIPT_NAME']) . '?' . http_build_query($canonical_query);
|
||||
echo '<link rel="alternate" href="'.$link.'" hreflang="'.$lang.'" />';
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user