update
This commit is contained in:
51
public/.htaccess
Normal file
51
public/.htaccess
Normal file
@@ -0,0 +1,51 @@
|
||||
RewriteEngine On
|
||||
|
||||
# ---------------------------------------------------------
|
||||
# 2) Uploads schützen
|
||||
# ---------------------------------------------------------
|
||||
RewriteRule ^uploads/avatar/ - [F]
|
||||
|
||||
# ---------------------------------------------------------
|
||||
# 3) Auth-Routen
|
||||
# ---------------------------------------------------------
|
||||
RewriteRule ^auth/login/?$ auth/login.php [L]
|
||||
RewriteRule ^auth/register/?$ auth/register.php [L]
|
||||
RewriteRule ^auth/logout/?$ auth/logout.php [L]
|
||||
|
||||
# ---------------------------------------------------------
|
||||
# 4) Tools-Regel
|
||||
# /tools/foo.php → landingpage/tools/foo.php
|
||||
# ---------------------------------------------------------
|
||||
RewriteCond %{REQUEST_URI} ^/tools/ [NC]
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^tools/(.*)$ landingpage/tools/$1 [L]
|
||||
|
||||
# ---------------------------------------------------------
|
||||
# 5) Generische Landingpage-Regel
|
||||
# ---------------------------------------------------------
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_URI} !^/(auth|assets|uploads|landingpage|tools|_errors)/ [NC]
|
||||
RewriteCond %{REQUEST_URI} ^/([^/]+)/?$ [NC]
|
||||
RewriteCond %{DOCUMENT_ROOT}/landingpage/%1/index.php -f
|
||||
RewriteRule ^ landingpage/%1/index.php [L]
|
||||
|
||||
# ---------------------------------------------------------
|
||||
# 6) Fallback-Regeln (.php und /index.php)
|
||||
# ---------------------------------------------------------
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_FILENAME}.php -f
|
||||
RewriteRule ^(.+?)/?$ $1.php [L]
|
||||
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_FILENAME}/index.php -f
|
||||
RewriteRule ^(.+?)/?$ $1/index.php [L]
|
||||
|
||||
# ---------------------------------------------------------
|
||||
# 7) Globaler 404-Fallback
|
||||
# ---------------------------------------------------------
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_URI} !^/(assets|uploads|auth|landingpage|tools|_errors)/ [NC]
|
||||
RewriteRule ^ _errors/404.php [L]
|
||||
27
public/_errors/404.php
Normal file
27
public/_errors/404.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
http_response_code(404);
|
||||
$appBaseUrl = rtrim($GLOBALS['app_base_url'] ?? '', '/');
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Seite nicht gefunden</title>
|
||||
<style>
|
||||
body{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#0f172a;color:#e2e8f0;margin:0;min-height:100vh;display:flex;align-items:center;justify-content:center;padding:2rem}
|
||||
.card{background:#1e293b;border-radius:1rem;padding:2rem;max-width:460px;text-align:center;box-shadow:0 25px 45px rgba(2,6,23,.45);}
|
||||
h1{margin-top:0;font-size:2rem}
|
||||
p{color:#cbd5f5}
|
||||
a{display:inline-flex;margin-top:1.5rem;padding:.6rem 1.4rem;border-radius:.8rem;background:#38bdf8;color:#0f172a;text-decoration:none;font-weight:600}
|
||||
a:hover{background:#0ea5e9;color:#fff}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="card">
|
||||
<h1>404 – Seite nicht gefunden</h1>
|
||||
<p>Die angeforderte Seite existiert nicht oder wurde verschoben.</p>
|
||||
<a href="<?= $appBaseUrl ?: '/' ?>">Zur Übersicht</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user