routing
This commit is contained in:
18
public/.htaccess
Normal file
18
public/.htaccess
Normal file
@@ -0,0 +1,18 @@
|
||||
RewriteEngine On
|
||||
|
||||
# 0) Echte Dateien oder Ordner direkt ausliefern (wichtig für CSS/JS/Bilder)
|
||||
RewriteCond %{REQUEST_FILENAME} -f [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -d
|
||||
RewriteRule ^ - [L]
|
||||
|
||||
# 1) /test/eins -> /test/eins.php (wenn existiert)
|
||||
RewriteCond %{REQUEST_FILENAME}.php -f
|
||||
RewriteRule ^(.+)$ $1.php [L]
|
||||
|
||||
# 2) /test/eins -> /test/eins/index.php (wenn existiert)
|
||||
RewriteCond %{REQUEST_FILENAME}/index.php -f
|
||||
RewriteRule ^(.+)$ $1/index.php [L]
|
||||
|
||||
# 3) Wenn nichts davon zutrifft:
|
||||
# Apache versucht, die URL normal zu bedienen → keine Datei → 404.
|
||||
# (Kein extra Rewrite nötig)
|
||||
Reference in New Issue
Block a user