URL-Manager will not route

Hi guys,

I cloned our repositorie and created excatly the same URL-rules like at my own project. Now, i will get error like this after having been logged in:




Firefox

Fehler: Umleitungsfehler

The website called is rerouting request,which never will come to an end.

This problem sometimes occures, if cookies are deactivated

................................................................................

Chrome

Diese Seite funktioniert nicht


localhost hat Sie zu oft weitergeleitet.

Löschen Sie Ihre Cookies.

ERR_TOO_MANY_REDIRECTS

................................................................................



I definetly accepted using cookies at both browser!! Debugging shows me,that I have dozen of 302-Requests,so Yii breaks down! I use Windows, not LINUX, so I don’t care about any permissions.

Here are the rules:




      'urlManager' => [

                'class' => 'yii\web\UrlManager',

                'enablePrettyUrl' => true,

                'showScriptName' => true,

                'enableStrictParsing' => true,

                'rules' => [

                    '/' => 'site/login',

                    'home' => 'site/index',

                    'logout' => 'site/logout',

                    'contact' => 'site/contact',

                    'signup' => 'site/signup',

                    'reset' => 'site/request-password-reset',

                    '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',

                    '<action:(contact|captcha)>' => 'site/<action>',

                    'debug' => '/debug',

                    'Gii' => '/gii'

                ],



Here is frontend configuration:




<?php


$config = [

    // LZA 17-07-30 

    'sourceLanguage' => 'de-DE',

    'language' => 'de-DE',

    // LZA 17-07-30 siehe  Funktionen in  http://demos.krajee.com/grid#module    

    'components' => [

        'request' => [

            // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation

            'cookieValidationKey' => '4lD2RxDNkC4ckpwxTmkDzOLIvk0JMs3F',

        ],

    ],

];


if (!YII_ENV_TEST) {

    // configuration adjustments for 'dev' environment

    $config['bootstrap'][] = 'debug';

    $config['modules']['debug'] = [

        'class' => 'yii\debug\Module',

    ];


    $config['bootstrap'][] = 'gii';

    $config['modules']['gii'] = [

        'class' => 'yii\gii\Module',

        // LZA 17-07-30 CRUD

        'generators' => [// customized CRUD generator

            'crud' => [

                // 'class' => 'app\myCrud\crud\Generator', // LZA 17-07-20 die Klasse von CRUD generator

                'class' => '\common\wsl_dev\wsl_crud\crud\Generator', // LZA 17-07-20 die Klasse von CRUD generator

                'templates' => [

                    'myCrud' => '/@common/wsl_dev/wsl_crud/crud/default', //LZA 17-07-20 Templatename und Templatepfad

                ]

            ]

        ],

            // LZA 17-07-30 CRUD        

    ];

}


return $config;



If I deacitvate URLManger,setting


 'enablePrettyUrl' => false,

everything works fine. If I’ll put in URL like this:


http://localhost/yii2_perswitch/frontend/web/yiic.php/home

everything works fine,too. i just have deleted all cookies,without some effects.

Any ideas,how to fix this?

Why are you going to yiic.php? Isn’t the entry script index.php

I renamed index.php to yiic.php, 'cause of Netbeans-Plugin which only will work with yiic.php. This is not the reason of error!!

What Netbeans plugin are you using? As I said in one of the other three posts about this problem, I have no trouble with Netbeans for PHP.

I have no problems with Netbeans and PHP,too, as I never had. Plugin, I am using will be named like this:




398754112_org-nbphpcouncil-modules-php-yii-0.8.1.nbm



This Plugin offers IntelliSense for yii2-Framework, but it requires renaming!

What webserver are you using?

IIS apache or nginx?

If you are using apache did you correct the .htaccess to poin to yiic.php instead of index.php?

Did you try if with index.php it works properly?

A suggestion, if you need yiic.php just for the ide create symlink to index.php instead renaming it.

Changing the name to yiic.php at least break the init scripts.

I solved problem accepting rewriting in nginx.

Thx,so far!