src/Controller/DefaultController.php
protected function returnToIndex(): void
    {
        $oInput    = Factory::service('Input');
        $sReferrer = $oInput->server('HTTP_REFERER');

        if (!empty($sReferrer)) {
            redirect($sReferrer);
        } else {
            redirect($this->getConfig()['BASE_URL']);
        }
    }
protected function returnToIndex(): void
    {
        $oInput    = Factory::service('Input');
        $sReferrer = $oInput->server('HTTP_REFERER');

        if (!empty($sReferrer)) {
            redirect($sReferrer);
        } else {
            redirect($this->getConfig()['BASE_URL']);
        }
    }
Returns the user to the index pagel if a referrer is available then go there instead
This is useful for returning the user to a filtered view

@throws FactoryException