您的位置:首页 > 运维架构 > Nginx

yii nginx 隐藏 index.php

2015-07-23 10:10 549 查看
原文链接:https://www.geek-share.com/detail/2648580899.html

1 nginx配置

 location / {
            index  index.html index.htm index.php;
            #autoindex  on;
            if (!-e $request_filename){
                rewrite ^/(.*) /index.php last;
            }
 }

2 yii  main配置

  'urlManager'=>array(
   'urlFormat'=>'path',
   'showScriptName'=>false,
   'rules'=>array(
    '<controller:\w+>/<id:\d+>'=>'<controller>/view',
    '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
    '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
   ),
  ),

转载于:https://www.geek-share.com/detail/2648580899.html

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: