protected function _decodeOldUrl($seoUrl)
    {
        $stringObject = getStr();
        $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
        $baseUrl = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopURL();
        if ($stringObject->strpos($seoUrl, $baseUrl) === 0) {
            $seoUrl = $stringObject->substr($seoUrl, $stringObject->strlen($baseUrl));
        }
        $shopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId();
        $seoUrl = rawurldecode($seoUrl);

        //extract page number from seo url
        list($seoUrl, $pageNumber) = $this->extractPageNumberFromSeoUrl($seoUrl);

        $key = $this->_getIdent($seoUrl, true);

        $url = false;
        $resultSet = $database->select("select oxobjectid, oxlang from oxseohistory where oxident = " . $database->quote($key) . " and oxshopid = '{$shopId}' limit 1");
        if (!$resultSet->EOF) {
            // updating hit info (oxtimestamp field will be updated automatically)
            $database->execute("update oxseohistory set oxhits = oxhits + 1 where oxident = " . $database->quote($key) . " and oxshopid = '{$shopId}' limit 1");

            // fetching new url
            $url = $this->_getSeoUrl($resultSet->fields['oxobjectid'], $resultSet->fields['oxlang'], $shopId);

            // appending with $_SERVER["QUERY_STRING"]
            $url = $this->_addQueryString($url);
        }
        if ($url && !is_null($pageNumber)) {
            $url = \OxidEsales\Eshop\Core\Registry::getUtilsUrl()->appendUrl($url, ['pgNr' => $pageNumber]);
        }

        return $url;
    }