# Onelya Cloud Panel
DirectoryIndex index.php
Options -Indexes

<FilesMatch "\.(md|sqlite|sqlite3|db|log|bak|sql|json|lock|ini|sh|dist)$|^\.">
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order allow,deny
        Deny from all
    </IfModule>
</FilesMatch>

<IfModule mod_rewrite.c>
    RewriteEngine On
    # HTTPS zorunlu (WHMCS eslestirmesi ve lisans icin gerekli)
    RewriteCond %{HTTPS} !=on
    RewriteCond %{HTTP:X-Forwarded-Proto} !=https
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    # app/ ve storage/ dizinlerine dogrudan erisim yok (kendi .htaccess dosyalari da vardir)
    RewriteRule ^(app|storage)(/|$) - [F,L]
</IfModule>
