34 lines
1.1 KiB
ApacheConf
34 lines
1.1 KiB
ApacheConf
RewriteEngine On
|
|
|
|
# -------------------------------------
|
|
# 1) Domains vom Typ *.ismyusbfake.com
|
|
# immer nach /fakecheck/ umleiten
|
|
# (SEO-freundlich: 301)
|
|
# -------------------------------------
|
|
RewriteCond %{HTTP_HOST} (^|\.)ismyusbfake\.com$ [NC]
|
|
# Keine Schleife, wenn schon /fakecheck... im Pfad
|
|
RewriteCond %{REQUEST_URI} !^/fakecheck(/|$) [NC]
|
|
RewriteRule ^.*$ /fakecheck/ [L,R=301]
|
|
|
|
# -------------------------------------
|
|
# 2) Ab hier DEINE bisherigen Regeln
|
|
# für echte Dateien/Ordner & PHP-Routing
|
|
# -------------------------------------
|
|
|
|
# 0) Echte Dateien und Ordner direkt ausliefern
|
|
RewriteCond %{REQUEST_FILENAME} -f [OR]
|
|
RewriteCond %{REQUEST_FILENAME} -d
|
|
RewriteRule ^ - [L]
|
|
|
|
# 1) /foo/bar -> /foo/bar.php (wenn die Datei existiert)
|
|
RewriteCond %{REQUEST_FILENAME} !-d
|
|
RewriteCond %{REQUEST_FILENAME}.php -f
|
|
RewriteRule ^(.+?)/?$ $1.php [L]
|
|
|
|
# 2) /foo/bar -> /foo/bar/index.php (wenn diese Datei existiert)
|
|
RewriteCond %{REQUEST_FILENAME} !-d
|
|
RewriteCond %{REQUEST_FILENAME}/index.php -f
|
|
RewriteRule ^(.+?)/?$ $1/index.php [L]
|
|
|
|
# 3) Kein Rewrite -> Apache liefert normalen 404, falls nix existiert
|