我必须关闭对 index.php 主页的访问,我使用以下代码修改了 siteController.php:
public function accessRules() {
return array(
// allow all users to perform 'index' and 'view' actions *
array('allow',
'actions' => array('index','view'),
'users' => array('admin'),
),
// allow authenticated user to perform 'create' and 'update' actions @
array('allow',
'actions' => array('create','update'),
'users' => array('admin'),
),
// allow admin user to perform 'admin' and 'delete' actions
array('allow',
'actions' => array('admin','delete'),
'users' => array('admin'),
),
// deny all users
array('deny',
'users' => array('*'),
),
);
}
因为我必须只为管理员授予访问权限。在此操作之后,我看到重定向正在工作,并且 url 变为index.php/site/login ,但我得到的不是登录/传递ERR_TOO_MANY_REDIRECTS
表单。希望你能理解我)