ERR_TOO_MANY_REDIRECTS logging in to ocadmin

Ask the community for help and support.
yeno
Posts: 5
Joined: Sat Dec 12, 2020 1:48 pm

Re: ERR_TOO_MANY_REDIRECTS logging in to ocadmin

Post by yeno »

Theory

Ok, Gary, I understand. But shared hosting settings cannot be changed. And for a user it doesn't seem to be like a hosting error, but an application. Because all the other CMS are working there.

My opinion is that it's not good idea to force a user to change his hosting where he can run another CMS, store data, etc. An accessibility is good for user. What is good for one user is good for the community. So, let's improve it. Agree?

BTW there are over 100.000 shared hostings with the same settings where I'm testing CE Phoenix. The provider offer pre-installed systems like WordPress, Joomla, etc. There is only one pre-installed e-commerce system, PrestaShop. I think there might be Phoenix too. But the first condition is a compatibility with hosting(s).

Solution suggestion

There should be new const INSTALLED_TO_SUBFOLDER = (true|false)
in admin/includes/configure.php
  • There can be opt-in checkbox INSTALLED_IN_SUBFOLDER in the installation, e.g. "Installation to subdirectory - if you install application to other subdirectory then root www/, e.g. www/mysubdirectory/".
  • Or it might be automatically detected from const DIR_FS_CATALOG.
    In my case DIR_FS_CATALOG = '/data/web/virtuals/USER-ID/virtual/www/subdom/eshop/'

The following code was NOT TESTED, it's just a concept.

admin/includes/configure.php (line 15)

Code: Select all

DIR_FS_CATALOG  = '/data/web/virtuals/USER-ID/virtual/www/subdom/eshop/'

if(stristr(DIR_FS_CATALOG, '/www/') {
    $subdir_path = explode(DIR_FS_CATALOG, , '/www/');
    $subdir_path = $subdir_path[1];
    if(subdir_path !=="") {
        const INSTALLED_TO_SUBFOLDER = true;
    } else {
        const INSTALLED_TO_SUBFOLDER = false;
    }
}
I know there should be not only condition but an exeption, whether the root folder is named "www". I think the probability is close to zero, "www" should be default, but…

admin/includes/application_top.php (line 42)

Code: Select all


  // set php_self in the local scope
  if(INSTALLED_TO_SUBFOLDER == true;) {  
      $PHP_SELF = basename($_SERVER['SCRIPT_NAME']);
  } else {
      $req = parse_url($_SERVER['SCRIPT_NAME']);
      $PHP_SELF = substr($req['path'], strlen(DIR_WS_ADMIN)); 
  }
What do you think about?
burt
Lead Developer
Lead Developer
Posts: 2423
Joined: Tue Oct 29, 2019 9:37 am
Has thanked: 49 times
Been thanked: 137 times

Re: ERR_TOO_MANY_REDIRECTS logging in to ocadmin

Post by burt »

> What do you think about?

Seems like a lot of work to deal with a situation that rarely arises. I don't want to go tail-chasing to suit hosts who set up their server in a non-standard way.
Gamechanger Addon: Queued Emails, try before you buy.
Post Reply