How to Fix ERR_TOO_MANY_REDIRECTS on PrestaShop Admin Panel

How to Fix ERR_TOO_MANY_REDIRECTS on PrestaShop Admin Panel

If you’re encountering the ERR_TOO_MANY_REDIRECTS error on your PrestaShop Admin Panel, specifically on the Modules and Products pages, you’re not alone. This issue often stems from misconfigurations related to session handling in PHP. In this article, we’ll explore the root cause and provide a step-by-step guide to resolving it.

Symptoms of the Issue

  • The error occurs only on specific admin pages, such as Modules and Products.
  • The URL may contain …security/compromised…, indicating a possible misconfiguration.
  • Renaming or disabling all modules does not resolve the issue.

Primary Cause: PHP Session Misconfiguration

One of the most common reasons for this error is an incorrect setting for session.save_path in your PHP configuration. If your session storage is misconfigured, PrestaShop may fail to establish a session properly, leading to redirection loops.

How to Fix the Error

1. Check and Set the Correct session.save_path

The correct session.save_path depends on your hosting environment:

  • For Linux-based servers (Apache/Nginx):
    session.save_path = "/tmp"
    
  • For Windows servers running WAMP:
    session.save_path = "c:/wamp64/tmp"
    

Make sure that the directory exists and is writable by the web server.

2. Verify session.save_handler

Ensure that your session handler matches the session.save_path. For example:

  • If using file-based sessions, it should be:
    session.save_handler = "files"
    session.save_path = "/tmp"
    
  • If using Redis or Memcached, do not mix local file storage with a TCP-based session handler. Example for Redis:
    session.save_handler = "redis"
    session.save_path = "tcp://127.0.0.1:6379"
    

3. Restart Web Server and PHP

After making changes to the PHP configuration, restart your web server to apply the settings:

service apache2 restart  # For Apache (Linux)
service nginx restart    # For Nginx (Linux)
net stop wampapache && net start wampapache  # For WAMP on Windows

4. Clear PrestaShop Cache

To ensure that the changes take effect, clear PrestaShop’s cache:

  • Delete the content of var/cache/prod and var/cache/dev manually:
    rm -rf var/cache/*
    
  • Or clear it from the PrestaShop Admin Panel:
    1. Go to Advanced Parameters > Performance.
    2. Click Clear cache.

Conclusion

The ERR_TOO_MANY_REDIRECTS error in PrestaShop often results from a misconfigured session handler. By ensuring that session.save_path is correctly set and matches the session handler, you can resolve the issue quickly. If the problem persists, check your server logs for additional clues.

If you found this guide helpful, let us know in the comments below!

Condividi:

Related Posts