Remove index.php references

This commit is contained in:
danwin1210 committed 2022-12-28 19:56:26 +01:00
1 parent 2976176ecb
commit 907a42ff7e
1 file changed
+1 -1
+1 -1
View File
@@ -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.'" />';
}
}