52 lines
2.0 KiB
ApacheConf
Executable File
52 lines
2.0 KiB
ApacheConf
Executable File
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|admin)/ [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|admin)/ [NC]
|
|
RewriteRule ^ _errors/404.php [L]
|