RewriteEngine On

# 1) Root von *.ismyusbfake.com nach /fakecheck/ umleiten
RewriteCond %{HTTP_HOST} (^|\.)ismyusbfake\.com$ [NC]
RewriteRule ^$ /fakecheck/ [L,R=301]

# 2) Wenn eine echte Datei oder Ordner existiert → direkt ausliefern
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# 3) /foo/bar -> /foo/bar.php (falls vorhanden)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+?)/?$ $1.php [L]

# 4) /foo/bar -> /foo/bar/index.php (falls vorhanden)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}/index.php -f
RewriteRule ^(.+?)/?$ $1/index.php [L]
