YII 框架的模块和子域
我在我的一个项目中使用 YII 框架,并且面临参数化主机名的问题,我有一个模块“ADMIN”,我想将其显示为我的域中的子域,所以我设置如下规则: protected/config/main.php:
'urlManager'=>array(
'urlFormat'=>'path',
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
'http://admin.moresoccerfun.com/login' => 'admin/default/index',
),
),
但是当我从浏览器运行页面:www.admin.moresoccerfun.com/login 时,它显示“未找到服务器”。请帮助我解决这个问题。
谢谢并期待您的回复。
I am using YII framework at one of my project and I am facing problem with Parameterizing Host Names, I have a module "ADMIN" and I want to display this as a subdomain within my domain, so I am setting rules like the following way from the protected/config/main.php:
'urlManager'=>array(
'urlFormat'=>'path',
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
'http://admin.moresoccerfun.com/login' => 'admin/default/index',
),
),
But when I am running the page: www.admin.moresoccerfun.com/login from the browser, it is showing "SERVER NOT FOUND". Please help me out from this problem.
Thanks and looking for your response.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 Yii 可以处理该请求之前,您的服务器需要正确配置。
基本上,您需要编辑 DNS 条目和 Apache 配置。
http://httpd.apache.org/docs/2.0/vhosts/examples.html
http://content.websitegear.com/article/subdomain_setup.htm
Before Yii can handle that request, your server needs to be properly configured.
Basically, you need to edit your DNS entries and your Apache config.
http://httpd.apache.org/docs/2.0/vhosts/examples.html
http://content.websitegear.com/article/subdomain_setup.htm