public function updateHtaccessFile($aParams, $sSubFolder = "")
    {
        /** @var \OxidEsales\EshopCommunity\Setup\Language $oLang */
        $oLang = $this->getInstance("Language");

        // preparing rewrite base param
        if (!isset($aParams["sBaseUrlPath"]) || !$aParams["sBaseUrlPath"]) {
            $aParams["sBaseUrlPath"] = "";
        }

        if ($sSubFolder) {
            $sSubFolder = $this->preparePath("/" . $sSubFolder);
        }

        $aParams["sBaseUrlPath"] = trim($aParams["sBaseUrlPath"] . $sSubFolder, "/");
        $aParams["sBaseUrlPath"] = "/" . $aParams["sBaseUrlPath"];

        $sHtaccessPath = $this->preparePath($aParams["sShopDir"]) . $sSubFolder . "/.htaccess";

        clearstatcache();
        if (!file_exists($sHtaccessPath)) {
            throw new Exception(sprintf($oLang->getText('ERROR_COULD_NOT_FIND_FILE'), $sHtaccessPath), Utilities::ERROR_COULD_NOT_FIND_FILE);
        }

        @chmod($sHtaccessPath, getDefaultFileMode());
        if (is_readable($sHtaccessPath) && ($fp = fopen($sHtaccessPath, "r"))) {
            $sHtaccessFile = fread($fp, filesize($sHtaccessPath));
            fclose($fp);
        } else {
            throw new Exception(sprintf($oLang->getText('ERROR_COULD_NOT_READ_FILE'), $sHtaccessPath), Utilities::ERROR_COULD_NOT_READ_FILE);
        }

        // overwriting settings
        $sHtaccessFile = preg_replace("/RewriteBase.*/", "RewriteBase " . $aParams["sBaseUrlPath"], $sHtaccessFile);
        if (is_writable($sHtaccessPath) && ($fp = fopen($sHtaccessPath, "w"))) {
            fwrite($fp, $sHtaccessFile);
            fclose($fp);
        } else {
            // error ? strange !?
            throw new Exception(sprintf($oLang->getText('ERROR_COULD_NOT_WRITE_TO_FILE'), $sHtaccessPath), Utilities::ERROR_COULD_NOT_WRITE_TO_FILE);
        }
    }