--- a/classes/Tools.php 2026-06-04 14:48:44.000000000 +0000 +++ b/classes/Tools.php 2026-06-23 16:34:13.226899992 +0000 @@ -269,8 +269,10 @@ */ public static function getShopDomain($http = false, $entities = false) { - if (!$domain = ShopUrl::getMainShopDomain()) { - $domain = Tools::getHttpHost(); + // EduBox: dynamic domain + keep non-standard ports (e.g. localhost:8088). + $domain = Tools::getHttpHost(false, false, false); + if (substr($domain, -3) === ':80' || substr($domain, -4) === ':443') { + $domain = substr($domain, 0, strrpos($domain, ':')); } if ($entities) { $domain = htmlspecialchars($domain, ENT_COMPAT, 'UTF-8'); @@ -292,14 +294,16 @@ */ public static function getShopDomainSsl($http = false, $entities = false) { - if (!$domain = ShopUrl::getMainShopDomainSSL()) { - $domain = Tools::getHttpHost(); + // EduBox: dynamic domain + keep non-standard ports. + $domain = Tools::getHttpHost(false, false, false); + if (substr($domain, -3) === ':80' || substr($domain, -4) === ':443') { + $domain = substr($domain, 0, strrpos($domain, ':')); } if ($entities) { $domain = htmlspecialchars($domain, ENT_COMPAT, 'UTF-8'); } if ($http) { - $domain = static::getProtocol((bool) Configuration::get('PS_SSL_ENABLED')) . $domain; + $domain = static::getProtocol(Tools::usingSecureMode()) . $domain; } return $domain; @@ -2246,7 +2250,7 @@ $rewrite_settings = (int) Configuration::get('PS_REWRITING_SETTINGS', null, null, (int) $uri['id_shop']); } - $domain_rewrite_cond = 'RewriteCond %{HTTP_HOST} ^' . $domain . '$' . PHP_EOL; + $domain_rewrite_cond = ''; // EduBox: removed HTTP_HOST condition for dynamic domains // Rewrite virtual multishop uri if ($uri['virtual']) { if (!$rewrite_settings) {