public function getUrl($page)
    {
        $request = Craft::$app->getRequest();

        // Get the query string params without the path or `pattern`
        parse_str($request->getQueryString(), $params);
        $pathParam = Craft::$app->getConfig()->getGeneral()->pathParam;
        unset($params[$pathParam], $params['pattern']);

        // Return the URL with the page param
        $params[$this->pageParam] = $page;
        return UrlHelper::url($request->getPathInfo(), $params);
    }