Question

Im trying to access my Yii code generator which is Gii. but when i browse it using

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

the page says

Error 404 Unable to resolve the request "gii/index".

this is my .htaccess file for url-rewriting

Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on

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

RewriteRule . index.php

and this is my url manager in my config file

    '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'),
        ),
    ),

did i went wrong on something? the http://localhost/mysite/gii/index/ shows the layout of the gii code generator but showing the Error 404...

thanks

P.S. I tried also to turn off my URL manager and see if my Gii code generator page will work by default by using this url http://localhost/mysite/index.php?r=gii/default/login and it works...

Was it helpful?

Solution

If you encounter the same problem with the same configuration I did use this URL http://localhost/mysite/gii/default/login

^_^

OTHER TIPS

use this .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

and try your URL:

http://localhost/mysite/gii/index/
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top