我正在用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