I am trying to deploy my Yii2 application using Deployer
My server is
Ubuntu server 16.4.10 LTS
Redirected too many times
Found the solution! Sometimes if a yii2 error occurs It shows too many redirects error instead of internal server error (500), so enable debug mode from web/index.php (uncomment these two lines):
defined('YII_DEBUG') or define('YII_DEBUG', true); defined('YII_ENV') or define('YII_ENV', 'dev');
and you can see exactly what causes the problem.
p.s: Redirected too many times error was because the 777 permissions for runtime and assets folder were not set.