php_flag engine off
RewriteEngine On
RewriteRule ^ ../index.php [L]
# Ohne mod_rewrite lieber gar nichts ausliefern
Require all denied
HTACCESS;
/** Schreibt die Regel; liefert false, wenn das nicht ging */
public static function install(?string $dir = null): bool
{
$dir ??= public_path('uploads');
if (! is_dir($dir) && ! @mkdir($dir, 0775, true)) {
return false;
}
return @file_put_contents($dir.'/.htaccess', self::HTACCESS) !== false;
}
public static function installed(?string $dir = null): bool
{
return @file_get_contents(($dir ?? public_path('uploads')).'/.htaccess') === self::HTACCESS;
}
}