Php joomla sh404sef-无法将动态会话值传递到url,它始终设置为一个值

Php joomla sh404sef-无法将动态会话值传递到url,它始终设置为一个值,php,joomla3.0,Php,Joomla3.0,我在joomla项目中使用了sh404sef组件。它在哪里工作很好。但我的情况是将城市名称传递到url上。我已根据用户选择将城市名称保存到会话中 我在router.php中写了一篇文章,通过city作为 $slt_city = JRequest::getVar("slt_city"); if(empty($slt_city)){ $session = JFactory::getSession(); $slt_city = $session->get(

我在joomla项目中使用了sh404sef组件。它在哪里工作很好。但我的情况是将城市名称传递到url上。我已根据用户选择将城市名称保存到会话中

我在router.php中写了一篇文章,通过city作为

$slt_city = JRequest::getVar("slt_city");
    if(empty($slt_city)){
        $session = JFactory::getSession();
        $slt_city = $session->get( 'slt_city' );
    }

if (!empty($slt_city)) {
        $segments[] = strtolower($slt_city);
        unset($query['city']);
    }
但它总是显示在url中,只有一个城市。也没有任何重复。有人能给出将会话值传递到URL的解决方案吗

我需要将url从xxxxx.com/electronics/whistalers更改为xxxxx.com/bangalore/electronics/whistalers xxxxx.com/mystore/electronics/whistalers