/public, // and the web server then reports the rewritten path in REQUEST_URI/SCRIPT_NAME. Laravel would see // "/releases/…/public/angebot/2" instead of "/angebot/2" (signed links would fail). The site is always // served from the domain root, so the internal prefix is removed here. if (preg_match('~^/(?:releases/[^/?]+|current)/public(?=[/?]|$)~', $_SERVER['REQUEST_URI'] ?? '', $internalPrefix)) { $path = substr($_SERVER['REQUEST_URI'], strlen($internalPrefix[0])); $_SERVER['REQUEST_URI'] = str_starts_with($path, '/') ? $path : '/'.$path; $_SERVER['SCRIPT_NAME'] = $_SERVER['PHP_SELF'] = '/index.php'; } // Bootstrap Laravel and handle the request... /** @var Application $app */ $app = require_once __DIR__.'/../bootstrap/app.php'; $app->handleRequest(Request::capture());