doumeng1897 2013-02-22 16:01
浏览 30
已采纳

在yii中更改默认页面

I'm fairly new to yii, would like to know how to change the default page pra that instead of going to the index is directed to a page comingsoon I have.

Thanks for your time.

  • 写回答

6条回答 默认 最新

  • dongshen3352 2013-02-22 16:39
    关注

    Method 1: Change view page rendered in SiteController.php's index action:

    public function actionIndex() {
        $this->render('index'); // change to "comingsoon"
    }
    

    Method 2: Let 404 error page display a coming soon message.

    Method 3: Redirect to error page using URL manager rules in main.php:

    'urlManager' => array(
        'rules' => array(
            'index'=>'site/index', // change "site/index" to "site/comingsoon"
            ...
    

    Method 4: .htaccess rewrite.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(5条)

报告相同问题?

悬赏问题

  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?