# Paket doğrudan public_html'e açıldığında istekleri public/ klasörüne yönlendirir.
# Alan adının kök dizini public/ klasörüne ayarlıysa bu dosya kullanılmaz.

Options -Indexes
DirectoryIndex index.php

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    # SSL doğrulama dosyaları
    RewriteRule ^\.well-known/ - [L]

    # Uygulama kodu, ayarlar ve kayıtlar dışarıdan okunamaz
    RewriteRule ^(\.env.*|\.git.*|composer\.(json|lock)|package(-lock)?\.json|README\.md|error_log)$ - [F,L,NC]
    RewriteRule ^(app|bootstrap|build|config|cron|database|node_modules|resources|routes|storage|vendor)(/|$) - [F,L,NC]

    RewriteCond %{REQUEST_URI} !^/public/
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

<FilesMatch "^\.env">
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
</FilesMatch>
