E
E
EVOSandru62014-12-09 03:54:07
Yii
EVOSandru6, 2014-12-09 03:54:07

PHP - Why is there a circular redirect when going to in gii?

I don't understand how it came to this, Loop
redirect detected on this page ReloadHide
details
Loading the web page at visakaz/en/gii/default/login caused too many redirects. Try clearing cookies for this server or allowing them to be accepted from third party sites. If that doesn't help, the problem might not be with your computer, but with the server's configuration.
Learn more about this issue.
Error code: ERR_TOO_MANY_REDIRECTS

Here is the config, if necessary, multilanguage is implemented on the site:

return array(
    'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
    'name'=>'VisaKaz',
 
    'sourceLanguage'=>'en',
    'language'=>'ru',
 
    'theme'=>'visakaz-blue',
 
    'params'=>array(
        // this is used in contact page
        'adminEmail'=>'[email protected]',
 
        'languages'=>array(
            'ru'=>'Русский',
            'en'=>'English',
            'de'=>'Deutsch',
            'ch'=>'中國',
            'tu'=>'Tьrk',
            'ar'=>'العربية'
        ),
    ),
 
    'preload'=>array(
        'log',
    ),
 
    'import'=>array(
        'application.models.*',
        'application.components.*',
    ),
 
    'modules'=>array(
 
        'gii'=>array(
            'class'=>'system.gii.GiiModule',
            'password'=>'123',
        ),
 
 
        'sadmin' => array(
            'layoutPath' => 'protected/modules/sadmin/views/layouts',
            'layout' => 'main',
            'defaultController' => 'Default',
        ),
        'papa',
 
    ),
 
    'components'=>array(
        'user'=>array(
            'allowAutoLogin'=>true,
        ),
 
        'request'=>array(
            'enableCookieValidation'=>true,
            'enableCsrfValidation'=>true,
        ),
 
        'urlManager'=>array(
            'class'=>'application.components.UrlManager',
            'urlFormat'=>'path',
            'showScriptName'=>false,
            'rules'=>array(
                '<language:(ru|en|de|ch|tu|ar)>/' => 'site/index',
                '<language:(ru|en|de|ch|tu|ar)>/<action:(contact|login|logout)>/*' => 'site/<action>',
                '<language:(ru|en|de|ch|tu|ar)>/<controller:\w+>/<id:\d+>'=>'<controller>/view',
                '<language:(ru|en|de|ch|tu|ar)>/<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
                '<language:(ru|en|de|ch|tu|ar)>/<controller:\w+>/<action:\w+>/*'=>'<controller>/<action>',
                '<language:(ru|en|de|ch|tu|ar)>/<module:\w+>/<controller:\w+>/<action:\w+>/<id:\d+>' => '<module>/<controller>/<action>/<id>',
                '<language:(ru|en|de|ch|tu|ar)>/<module:\w+>/<controller:\w+>/<action:\w+>' => '<module>/<controller>/<action>',
            ),
        ),
 
        'config'=>array(
            'class' => 'DConfig'
        ),
 
        'db'=>array(
            'connectionString' => 'mysql:host=localhost;dbname=visakaz',
            'emulatePrepare' => true,
            'username' => 'root',
            'password' => '',
            'charset' => 'utf8',
        ),
 
        'errorHandler'=>array(
            // use 'site/error' action to display errors
            'errorAction'=>'site/error',
        ),
        'log'=>array(
            'class'=>'CLogRouter',
            'routes'=>array(
                array(
                    'class'=>'CFileLogRoute',
                    'levels'=>'error, warning',
                ),
                // uncomment the following to show log messages on web pages
            ),
        ),
    ),
);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Benkovsky, 2014-12-09
@benbor

1. Open the element inspector, network tab
2. Log in and look in the tab
3. There, in theory, there should be One post request (sending login / password) returning a 302 response, with the Location header: site.my/after_login_page
4. Next the page (in my example, after_login_page) should already give 200 with content, but apparently it gives 300
, look in this direction.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question