-
-
Save EugeneZheleznov/71abc261351d64009700396df547c16c to your computer and use it in GitHub Desktop.
[PHP Redirect] php редирект #php
This file contains 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
// Например так | |
// Получаем адрес URL, сравниваем текущий с тем, с которого надо сделать редирект | |
// если совпадает, происходит редирект | |
// В примере ниже показан редирект со страницы без слеша, на страницу со слешем | |
<?php | |
$productUrl = ((!empty($_SERVER['HTTPS'])) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; | |
if ($productUrl == 'https://www.geos24.ru/services/inzhenernye-izyskaniya/rekonstrukxhiya') { | |
header( 'Location: https://www.geos24.ru/services/inzhenernye-izyskaniya/rekonstrukxhiya/', true, 301 ); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment