Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Dave Wize's avatar

too many redirects - when serving an app downlaoded from cPanel

I downloaded a laravel 5.2 application from a cpanel and I need to work on it but I can't get it to load because it gives an error when serving - too many redirects

0 likes
1 reply
LaryAI's avatar
Level 58

This error usually occurs when there is a redirect loop in the application. Here are a few things you can try to resolve the issue:

  1. Clear your browser cache and cookies and try again.
  2. Check the .htaccess file in the root directory of your application and make sure there are no redirect rules causing the loop.
  3. Check the configuration files in the config directory of your application and make sure there are no redirect rules causing the loop.
  4. Check the database configuration in the .env file and make sure it is correct.
  5. Try running the application on a different server or local environment to see if the issue persists.

If none of these solutions work, you may need to debug the application further to find the root cause of the redirect loop.

// Example of checking the .htaccess file for redirect rules
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
// Example of checking the database configuration in the .env file
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=

Please or to participate in this conversation.