Skip to content

Instantly share code, notes, and snippets.

@Itachi261092
Created January 27, 2017 08:57
Show Gist options
  • Save Itachi261092/60060ccd3dbf2477e322a6043b82ab4d to your computer and use it in GitHub Desktop.
Save Itachi261092/60060ccd3dbf2477e322a6043b82ab4d to your computer and use it in GitHub Desktop.
URL rewrite for bitrix
// Initialize
$context = Bitrix\Main\Context::getCurrent();
$server = $context->getServer();
$server_array = $server->toArray();
// Скармливаем URL. Установить GET-параметры
$server_array['REQUEST_URI'] = $_SERVER['REQUEST_URI'] . $type . implode('&', $str);
$server->set($server_array);
$context->initialize(new Bitrix\Main\HttpRequest($server, array(), array(), array(), $_COOKIE), $context->getResponse(), $server);
$APPLICATION->reinitPath();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment