Php 如何在yii中启用url管理器?

Php 如何在yii中启用url管理器?,php,yii,Php,Yii,我已经取消了以下代码的注释,但它不起作用。它给了我一个错误404 not found 当我使用 > http://localhost:63342/forms/index.php/gii 在注释url管理器代码后,输入路径 > http://localhost:63342/forms/index.php?r=gii works fine. I am using windows Operating system. > > > 'urlManager'=>a

我已经取消了以下代码的注释,但它不起作用。它给了我一个错误404 not found 当我使用

> http://localhost:63342/forms/index.php/gii
在注释url管理器代码后,输入路径

> http://localhost:63342/forms/index.php?r=gii works fine. I am using windows Operating system.

> 
> 
> '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>',
>     ), ),
>http://localhost:63342/forms/index.php?r=gii 很好。我正在使用windows操作系统。
> 
> 
>“urlManager”=>数组(
>“urlFormat'=>“路径”,
>'showScriptName'=>false,
>'规则'=>数组(
>“/”=>“/视图”,
>         '//'=>'/',
>         '/'=>'/',
>     ), ),

如果您使用的是apache web服务器,则可以在webroot目录中启用mod_rewrite extension end configure.htaccess文件

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php

重新启动发动机
重写基/
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php

尝试打开
http://localhost:63342/forms/gii
取而代之的是
http://localhost:63342/forms/index.php/gii
。只需尝试从urlno中删除
index.php
,这不起作用。