我正在用PHP Yii Framework开发网站,我现在是堆栈,我需要启动gii,但是我不能这样做。当我键入www.example.com/index.php/gii或www.example.com/gii它给了我这个错误:Yii无法启动gii
/gii/default/login // <- website redirects to here
This webpage has a redirect loop
The webpage at http://www.example.com/gii/default/login has resulted in too many redirects.
Clearing your cookies for this site or allowing third-party cookies may fix the problem.
If not, it is possibly a server configuration issue and not a problem with your computer.
我不认为错误是因为修改htaccess以及主要的配置,但无论如何,这里是main.php配置文件:
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'rules'=>array(
'site/page/<view:\w+>'=>'site/page',
'<controller:\w+>/<cact:\w+>/<action:\w+>'=>'<controller>/<cact>',
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
和的.htaccess:
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
#non-www to www
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
# 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 [L]
所以你能帮助我吗?
这是准备好的设置在main.php中,我能够使用Gii,直到我将默认网址更改为用户友好的URL – Irakli 2012-03-14 18:21:43
我在第二块代码中发布的链接表明如果您使用用户友好的网址,您必须执行的操作。 – 2012-03-14 18:24:39
非常感谢,一切正常!再次感谢你! – Irakli 2012-03-14 18:40:04