Last active
March 16, 2022 12:46
-
-
Save aktaumag/36c45babde04c1b3565cb607c78b8a3c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ws_uri_parts = explode('?', $_SERVER['REQUEST_URI'], 2); | |
$ws_uri_protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://"; | |
$ws_uri_canonical = $ws_uri_protocol . $_SERVER['HTTP_HOST'] . $ws_uri_parts[0]; |
// Перенаправление на страницу без index.php
$ws_uri_parts = explode('?', $_SERVER['REQUEST_URI'], 2);
if(substr($ws_uri_parts[0], -10) == '/index.php'){
header($_SERVER['SERVER_PROTOCOL'] . " 301 Moved Permanently");
header("Location: ".$wscanonical);
exit();
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
WebaSyst
В админке находим шаблон и в файле index.html добавляем перед стандартным выводом тега небольшую модификацию