Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Убираем страницы с адресом http://site.site/element_code/random с учетом GET параметров
<?
//удалаем GET
$url = explode('?', $_SERVER['REQUEST_URI']);
//получаем ссылку без GET
$url = $url[0];
//преобразовываем в массив
$pieces = explode("/", $url);
$new_array = array_diff($pieces, array(''));
//проверяем соответствие кода элемента и последнего элемента массива
if(end($new_array)!=$_REQUEST["ELEMENT_CODE"])
LocalRedirect("/404.php", "404 Not Found");
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.