Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/293.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 yii管理组的设置_Php_Model View Controller_Yii_Yii Url Manager - Fatal编程技术网

Php yii管理组的设置

Php yii管理组的设置,php,model-view-controller,yii,yii-url-manager,Php,Model View Controller,Yii,Yii Url Manager,我想在我现有的yii项目中创建管理面板。为此,我正在使用 现在我可以访问“localhost/dir/backend.php”。我想将此url设置为“localhost/dir/backend”,还想在admin中设置用于登录和其他链接的url管理。 我的配置文件代码是 'urlManager' => array( 'urlFormat' => 'path', 'showScriptName' => false, 'rules' => array(

我想在我现有的yii项目中创建管理面板。为此,我正在使用

现在我可以访问“localhost/dir/backend.php”。我想将此url设置为“localhost/dir/backend”,还想在admin中设置用于登录和其他链接的url管理。 我的配置文件代码是

'urlManager' => array(
    'urlFormat' => 'path',
    'showScriptName' => false,
    'rules' => array(
        'admin' => 'site/index',
        'admin/<_c>' => '<_c>',
        'admin/<_c>/<_a>' => '<_c>/<_a>',
    ),
),
'urlManager'=>数组(
“urlFormat”=>“路径”,
'showScriptName'=>false,
'规则'=>数组(
“管理员”=>“站点/索引”,
“admin/”=>“”,
“admin/”=>“/”,
),
),
请告诉我如何访问上述网址和登录网址和其他网址的管理员。
谢谢

如果您在Apache上运行应用程序,则需要使用以下规则添加.htaccess应用程序根目录

RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php