diff --git a/scripts/jobs/cron_tasks.inc.http.10.apache.php b/scripts/jobs/cron_tasks.inc.http.10.apache.php index 02e7820f..d1c012e9 100644 --- a/scripts/jobs/cron_tasks.inc.http.10.apache.php +++ b/scripts/jobs/cron_tasks.inc.http.10.apache.php @@ -610,14 +610,15 @@ class apache { && ((int)$domain['ismainbutsubto'] == 0 || domainMainToSubExists($domain['ismainbutsubto']) == false) ) { - $vhost_no = '22'; + $vhost_no = '35'; } elseif ((int)$domain['parentdomainid'] == 0 && isCustomerStdSubdomain((int)$domain['id']) == false && (int)$domain['ismainbutsubto'] > 0 ) { - $vhost_no = '21'; + $vhost_no = '30'; } else { - $vhost_no = '20'; + // number of dots in a domain specifies it's position (and depth of subdomain) starting at 29 going downwards on higher depth + $vhost_no = (string)(30 - substr_count($domain['domain'], ".") + 1); } if ($ssl_vhost === true) { @@ -1118,9 +1119,9 @@ class apache { $vhosts_file = ''; // sort by filename so the order is: - // 1. subdomains 20 - // 2. subdomains as main-domains 21 - // 3. main-domains 22 + // 1. subdomains x-29 + // 2. subdomains as main-domains 30 + // 3. main-domains 35 // #437 ksort($this->virtualhosts_data); diff --git a/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php b/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php index f1cf1038..f02e7503 100644 --- a/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php +++ b/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php @@ -299,7 +299,7 @@ class lighttpd { $_pos = strrpos($_tmp_path, '/'); $_inc_path = substr($_tmp_path, $_pos+1); - // subdomain + // maindomain if ((int)$domain['parentdomainid'] == 0 && isCustomerStdSubdomain((int)$domain['id']) == false && ((int)$domain['ismainbutsubto'] == 0 @@ -314,9 +314,10 @@ class lighttpd { ) { $vhost_no = '51'; } - // main domain + // subdomains else { - $vhost_no = '52'; + // number of dots in a domain specifies it's position (and depth of subdomain) starting at 89 going downwards on higher depth + $vhost_no = (string)(90 - substr_count($domain['domain'], ".") + 1); } if ($ssl == '1') { diff --git a/scripts/jobs/cron_tasks.inc.http.30.nginx.php b/scripts/jobs/cron_tasks.inc.http.30.nginx.php index 758e504a..b2c1d69c 100644 --- a/scripts/jobs/cron_tasks.inc.http.30.nginx.php +++ b/scripts/jobs/cron_tasks.inc.http.30.nginx.php @@ -289,14 +289,15 @@ class nginx { && ((int)$domain['ismainbutsubto'] == 0 || domainMainToSubExists($domain['ismainbutsubto']) == false) ) { - $vhost_no = '22'; + $vhost_no = '35'; } elseif ((int)$domain['parentdomainid'] == 0 && isCustomerStdSubdomain((int)$domain['id']) == false && (int)$domain['ismainbutsubto'] > 0 ) { - $vhost_no = '21'; + $vhost_no = '30'; } else { - $vhost_no = '20'; + // number of dots in a domain specifies it's position (and depth of subdomain) starting at 29 going downwards on higher depth + $vhost_no = (string)(30 - substr_count($domain['domain'], ".") + 1); } if ($ssl_vhost === true) {