// Update path info
$request->setPathInfo($this->createPathInfo($request, $shop));
$host = $request->getHeader('X_FORWARDED_HOST'); if($host !== null && $host === $shop->getHost()){ // If the base path is null, set it to empty string. Otherwise the request will try to assemble the base path. On a reverse proxy setup with varnish this will fail on virtual URLs like /en
// The X-Forwarded-Host header is only set in such environments
if($shop->getBasePath() === null){ $shop->setBasePath(''); }