假设域名为a.zf,现在准备将admin模块映射成admin.zf
参考了.html这篇文章
配置虚拟主机,将域名指向文件夹
编辑YII配置文件
'user'=>array(
// enable cookie-basedauthentication
'allowAutoLogin'=>true,
'identityCookie'=>array('domain'=> '.zf','path' => '/'),
),
'session' => array(
'cookieParams' =>array('domain' => '.zf', ),
'timeout' => 3600,
),
// uncomment the following to enableURLs in path-format
'urlManager'=>array(
'urlFormat'=>'path',
'rules'=>array(
'<controller:w+>/<id:d+>'=>'<controller>/view',
''=>'/admin',
),
),
'statePersister'=>array(
'class'=>'CStatePersister',
'stateFile'=>'protected/runtime/state.bin',
),
原文中'stateKeyPrefix'参数可以不要。该配置下的登陆cookie和原来的类似。不记住登陆的话,当前绘画期间有效。
目前模块中的url还有问题
转载于:
本文发布于:2024-01-31 18:39:17,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170669756030552.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |