Jump to content
Sign in to follow this  
FlagShipper

SSL too many redirects

Recommended Posts

I got SSL hooked up on my site, mostly, but have a few hiccups. The main one being I can no longer log into my admin page! My phone has been saying ERR_TOO_MANY_REDIRECTS  since I started with SSL but it would load fine on my laptop but just now I'm getting the same error on my laptop as well and haven't changed anything since it was working fine 10 minutes ago. I tried with firefox and chrome, cleared cookies and still nothing. I'd love for it to work on my phone but not sure what settings I need to change, as I had scoured around the forum to change the config until I found one that would load it without everything being broken. I'm using 2.3.4BS

Nothing is showing up in the error_log, this is the /admin/includes/config

<?php
  define('HTTP_SERVER', 'https://website.com');
  define('HTTPS_SERVER', 'https://website.com');
  define('ENABLE_SSL', true);
  define('HTTP_COOKIE_DOMAIN', 'https://website.com');
  define('HTTPS_COOKIE_DOMAIN', 'https://website.com');
  define('HTTP_COOKIE_PATH', '/admin');
  define('HTTPS_COOKIE_PATH', '/admin');
  define('HTTP_CATALOG_SERVER', 'https://website.com');
  define('HTTPS_CATALOG_SERVER', 'https://website.com');
  define('ENABLE_SSL_CATALOG', 'true');
  define('DIR_FS_DOCUMENT_ROOT', '/home/username/domains/website.com/public_htm/');
  define('DIR_WS_ADMIN', '/admin/');
  define('DIR_WS_HTTPS_ADMIN', '/admin/');
  define('DIR_FS_ADMIN', '/home/username/domains/website.com/public_html/admin/');
  define('DIR_WS_CATALOG', '/');
  define('DIR_WS_HTTPS_CATALOG', '/');
  define('DIR_FS_CATALOG', '/home/username/domains/website.com/public_html/');
  define('DIR_WS_IMAGES', 'images/');
  define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
  define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');
  define('DIR_WS_INCLUDES', 'includes/');
  define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
  define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
  define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
  define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
  define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
  define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');
  define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
  define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
  define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
  define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');
  define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
  define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

  define('DB_SERVER', 'localhost');
  define('DB_SERVER_USERNAME', 'username');
  define('DB_SERVER_PASSWORD', 'password');
  define('DB_DATABASE', 'database');
  define('USE_PCONNECT', 'false');
  define('STORE_SESSIONS', 'mysql');
  define('CFG_TIME_ZONE', 'America/Chicago');
?>

I wasn't sure if it was an .htaccess issue so turned it off but no change

Share this post


Link to post
Share on other sites

At least 3 errors there.

define('HTTP_COOKIE_DOMAIN', 'https://website.com');
define('HTTPS_COOKIE_DOMAIN', 'https://website.com');

to

define('HTTP_COOKIE_DOMAIN', '.website.com');
define('HTTPS_COOKIE_DOMAIN', '.website.com');

define('DIR_FS_DOCUMENT_ROOT', '/home/username/domains/website.com/public_htm/');

to

define('DIR_FS_DOCUMENT_ROOT', '/home/username/domains/website.com/public_html/');

Correcting those will get you a little further.

Share this post


Link to post
Share on other sites
Just now, burt said:

 

You have my undying gratitude sir :) I don't know what changed but your suggestion fixed it :)

Edited by dixiegiftshop
misquote

Share this post


Link to post
Share on other sites

In my case, the many redirects problem was due to a wrong cookie path set in configure.php. The correct one should be:

Quote

  const COOKIE_OPTIONS = [
    'lifetime' => 0,
    'domain' => 'yourdomain.com',
    'path' => '/admin/',               // path must have a trailing slash, somehow it was missing during installation
    'samesite' => 'Lax',
  ];

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×