【问题标题】:module and subdomain for YII frameworkYII 框架的模块和子域
【发布时间】:2012-02-13 18:33:24
【问题描述】:

我在我的一个项目中使用 YII 框架,并且在参数化主机名方面遇到问题,我有一个模块“ADMIN”,我想将其显示为我域中的子域,所以我正在设置规则,例如从受保护的/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 时,它显示“未找到服务器”。请帮我解决这个问题。

感谢并期待您的回复。

【问题讨论】:

    标签: module yii subdomain


    【解决方案1】:

    在 Yii 可以处理该请求之前,您的服务器需要正确配置。 基本上,您需要编辑 DNS 条目和 Apache 配置。

    http://httpd.apache.org/docs/2.0/vhosts/examples.html http://content.websitegear.com/article/subdomain_setup.htm

    【讨论】:

    • 好的,非常感谢您的回复,我该如何更改我的服务器的VirtualHost?表示我有服务器的Cpanel访问权限,我可以在哪个进程中更改?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-02-05
    • 1970-01-01
    • 2014-05-17
    • 1970-01-01
    • 1970-01-01
    • 2016-08-22
    • 1970-01-01
    相关资源
    最近更新 更多