public static function excludeQueryParametersFromUrl($originalUrl, $idSite)
    {
        $originalUrl = self::cleanupUrl($originalUrl);

        $parsedUrl = @parse_url($originalUrl);
        $parsedUrl = self::cleanupHostAndHashTag($parsedUrl, $idSite);
        $parametersToExclude = self::getQueryParametersToExclude($idSite);

        if (empty($parsedUrl['query'])) {
            if (empty($parsedUrl['fragment'])) {
                return UrlHelper::getParseUrlReverse($parsedUrl);
            }

            // Exclude from the hash tag as well
            $queryParameters = UrlHelper::getArrayFromQueryString($parsedUrl['fragment']);
            $parsedUrl['fragment'] = UrlHelper::getQueryStringWithExcludedParameters($queryParameters, $parametersToExclude);
            $url = UrlHelper::getParseUrlReverse($parsedUrl);

            return $url;
        }

        $queryParameters = UrlHelper::getArrayFromQueryString($parsedUrl['query']);
        $parsedUrl['query'] = UrlHelper::getQueryStringWithExcludedParameters($queryParameters, $parametersToExclude);
        $url = UrlHelper::getParseUrlReverse($parsedUrl);

        return $url;
    }
public static function excludeQueryParametersFromUrl($originalUrl, $idSite)
    {
        $originalUrl = self::cleanupUrl($originalUrl);

        $parsedUrl = @parse_url($originalUrl);
        $parsedUrl = self::cleanupHostAndHashTag($parsedUrl, $idSite);
        $parametersToExclude = self::getQueryParametersToExclude($idSite);

        if (empty($parsedUrl['query'])) {
            if (empty($parsedUrl['fragment'])) {
                return UrlHelper::getParseUrlReverse($parsedUrl);
            }

            // Exclude from the hash tag as well
            $queryParameters = UrlHelper::getArrayFromQueryString($parsedUrl['fragment']);
            $parsedUrl['fragment'] = UrlHelper::getQueryStringWithExcludedParameters($queryParameters, $parametersToExclude);
            $url = UrlHelper::getParseUrlReverse($parsedUrl);

            return $url;
        }

        $queryParameters = UrlHelper::getArrayFromQueryString($parsedUrl['query']);
        $parsedUrl['query'] = UrlHelper::getQueryStringWithExcludedParameters($queryParameters, $parametersToExclude);
        $url = UrlHelper::getParseUrlReverse($parsedUrl);

        return $url;
    }
public static function excludeQueryParametersFromUrl ( $ originalUrl , $ idSite ) { $ originalUrl = self :: cleanupUrl ( $ originalUrl ) ; $ parsedUrl = @ parse_url ( $ originalUrl ) ; $ parsedUrl = self :: cleanupHostAndHashTag ( $ parsedUrl , $ idSite ) ; $ parametersToExclude = self :: getQueryParametersToExclude ( $ idSite ) ; if ( empty ( $ parsedUrl [ 'query' ] ) ) { if ( empty ( $ parsedUrl [ 'fragment' ] ) ) { return UrlHelper :: getParseUrlReverse ( $ parsedUrl ) ; } // Exclude from the hash tag as well $ queryParameters = UrlHelper :: getArrayFromQueryString ( $ parsedUrl [ 'fragment' ] ) ; $ parsedUrl [ 'fragment' ] = UrlHelper :: getQueryStringWithExcludedParameters ( $ queryParameters , $ parametersToExclude ) ; $ url = UrlHelper :: getParseUrlReverse ( $ parsedUrl ) ; return $ url ; } $ queryParameters = UrlHelper :: getArrayFromQueryString ( $ parsedUrl [ 'query' ] ) ; $ parsedUrl [ 'query' ] = UrlHelper :: getQueryStringWithExcludedParameters ( $ queryParameters , $ parametersToExclude ) ; $ url = UrlHelper :: getParseUrlReverse ( $ parsedUrl ) ; return $ url ; }
Given the Input URL, will exclude all query parameters set for this site

@static
@param $originalUrl
@param $idSite
@return bool|string Returned URL is HTML entities decoded
Given the Input URL will exclude all query parameters set for this site