diff --git a/index.php b/index.php index d4b776c..fcbe41a 100644 --- a/index.php +++ b/index.php @@ -10,6 +10,11 @@ $requestUrl = trim(str_replace($_SERVER['QUERY_STRING'], '', $_SERVER['REQUEST_U if (preg_match(REQUEST_REGEX, $requestUrl, $match)) { $requestSupplier = array_key_exists('supplier', $match) ? $match['supplier'] : null; $requestEvent = array_key_exists('event', $match) ? $match['event'] : null; + + if (!is_null($requestEvent)) + $requestUrl = rtrim(str_replace($requestEvent, '', $requestUrl), '/'); + if (!is_null($requestSupplier)) + $requestUrl = rtrim(str_replace($requestSupplier, '', $requestUrl), '/'); } function generateUrl($supplier = null, $event = null) {