Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/256.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何重定向到另一个输入脚本?_Php_Yii - Fatal编程技术网

Php 如何重定向到另一个输入脚本?

Php 如何重定向到另一个输入脚本?,php,yii,Php,Yii,我的应用程序上有两个输入脚本,如下所述。如何设置重定向/example.com/admin到example.com/backend.php的路由 谢谢。请查看有关URL管理的文档: 在不知道设置细节的情况下,在protected/config/main.php(如果main.php是应用程序配置文件)中,您将需要以下内容: // note: this is extracted from a project which uses 'friedly urls', // depend

我的应用程序上有两个输入脚本,如下所述。如何设置重定向/example.com/admin到example.com/backend.php的路由


谢谢。

请查看有关URL管理的文档:

在不知道设置细节的情况下,在
protected/config/main.php
(如果
main.php
是应用程序配置文件)中,您将需要以下内容:

// note: this is extracted from a project which uses 'friedly urls',
//       depending on your setup, YMMV
'urlManager'=>array(
    'urlFormat'=>'path',
    'showScriptName' => false,
    'rules'=>array(
        '<controller:\w+>/<id:\d+>'=>'<controller>/view',
        '/admin'=>'/backend',    // <-- define your custom routes/redirects here
    ),
),
//注意:这是从使用“friedly URL”的项目中提取的,
//根据您的设置,YMMV
“urlManager”=>数组(
“urlFormat'=>“路径”,
'showScriptName'=>false,
'规则'=>数组(
“/”=>“/视图”,
“/admin'=>”/backend'//