2012-03-06 101 views
1

我試圖訪問我的Yii代碼生成器是Gii。 但是當我瀏覽它使用Gii代碼生成器錯誤頁

http://localhost/mysite/gii/index/

頁說

錯誤404 無法解析請求 「GII /索引」。

這是我的URL重寫.htaccess文件

Options +FollowSymLinks 
IndexIgnore */* 
RewriteEngine on 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 

RewriteRule . index.php 

,這是我的網址經理,我的配置文件

'urlManager'=>array(
     'urlFormat'=>'path', 
     'rules'=>array(
      '<controller:\w+>/<id:\d+>'=>'<controller>/view', 
      '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>', 
      '<controller:\w+>/<action:\w+>'=>'<controller>/<action>', 
     //pages 
     '<view>'=>array('site/page'), 
     ), 
    ), 

我做了錯誤的東西? 的http://localhost/mysite/gii/index/顯示GII碼發生器,但是示出了錯誤404的

感謝佈局...

P.S. 我想也關掉我的網址管理器,看看如果我的GII代碼生成頁面將默認工作通過使用這個網址http://localhost/mysite/index.php?r=gii/default/login 和它的作品...

+0

你不需要索引/最後... http:// localhost/mysite/gii/should work – 2012-03-06 04:58:49

回答

0

利用這個的.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 

並嘗試你的網址:

http://localhost/mysite/gii/index/