Yii参数化主机名。我错过了什么?

Yii参数化主机名。我错过了什么?,yii,Yii,我无法使yii参数化主机名正常工作。我试图在用户单击登录时显示 我已使用SiteController创建了成员模块 在我的规则中,我有: 'rules' => array( '<controller:\w+>/<id:\d+>' => '<controller>/view', '<controller:\w+>/<action:\w+>' => '<

我无法使yii参数化主机名正常工作。我试图在用户单击登录时显示

我已使用SiteController创建了成员模块

在我的规则中,我有:

'rules' => array(
                '<controller:\w+>/<id:\d+>' => '<controller>/view',
                '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
                '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
                'http://member.testsite.com' => 'member/site/index',
            ),
当我将鼠标悬停在login上时,它会显示member.testsite.com,但当我单击它时,它会将我带到website-unavailable.com

当我将规则更改为

'http://member.testsite.com' => 'member/<controller>/<action>',
它带我去testsite.com/member/site/index/

我是否遗漏了任何步骤?

示例:

'rules' => array(
    '://<member:\w+>.<host>/<controller:\w+>/<action:\w+>'
        => '<controller>/<action>',
),

感谢@Valery的回复。URL仍然解析为testsite.com/member/site/index,而不是member.testsite.com/site/index。我必须将member.testsite.com添加到apache conf吗?当然,您应该配置通配符域和web服务器。在这种情况下,文档根是什么?我的文档根为DocumentRoot/var/www/testsite/frontend/www for testsite.com。我应该为member.testsite.com保留相同的内容吗?@skris yes,/var/www/testsite/frontend/www
'rules' => array(
    '://<member:\w+>.<host>/<controller:\w+>/<action:\w+>'
        => '<controller>/<action>',
),