# ============================================================
#  SMM Panel - Root .htaccess for shared hosting
# ============================================================
#  استخدم هذا الملف فقط إذا لم تستطع توجيه الدومين إلى مجلد public/.
#  يقوم بإعادة توجيه كل الطلبات إلى public/ تلقائيًا.
# ============================================================

<IfModule mod_rewrite.c>
    RewriteEngine On

    # إذا كان الطلب داخل public/ بالفعل، لا تعِد التوجيه
    RewriteCond %{REQUEST_URI} ^/public/
    RewriteRule ^ - [L]

    # وجّه كل شيء إلى public/
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

# منع الوصول لملفات المشروع الحساسة
<FilesMatch "^\.env|composer\.(json|lock)$|\.(git|sh)$">
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order allow,deny
        Deny from all
    </IfModule>
</FilesMatch>

# تعطيل عرض محتويات المجلدات
Options -Indexes