我们有joomla网站,当会话不活动时,特定的URL会转到登录页面,并且在成功登录后不会重定向


We have joomla site, a specific URL goes to login page when session is not active and does not get redirect after successful login

我们有Joomla基地网站 - 当用户登录时,特定页面的给定URL工作正常。

如果用户未登录,则 url 将重定向到登录页面并保留在那里。

登录后如何重定向浏览器以加载预期的页面?

在您创建 url 以执行重定向的位置将返回参数附加到它。类似的东西应该有效:

$return = base64_encode(JURI::getInstance(
              JFactory::getURI()->toString(array('path', 'query', 'fragment'))
          ));
JFactory::getApplication()->redirect(
    JRoute::_('index.php?option=com_users&view=login&return=' . $return, true, true)
);