Files
fewo-stommer/public/index.php

31 lines
1.2 KiB
PHP

<?php
use Illuminate\Foundation\Application;
use Illuminate\Http\Request;
define('LARAVEL_START', microtime(true));
// Determine if the application is in maintenance mode...
if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
require $maintenance;
}
// Register the Composer autoloader...
require __DIR__.'/../vendor/autoload.php';
// Strato: the domain points at the deployment folder and .htaccess forwards to releases/<version>/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());