
#----------------------------------------------------------------cp:ppd
# Section managed by cPanel: Password Protected Directories     -cp:ppd
# - Do not edit this section of the htaccess file!              -cp:ppd
#----------------------------------------------------------------cp:ppd
AuthType Basic
AuthName "Protected 'public_html/a-cp'"
AuthUserFile "/home/buogedui/.htpasswds/public_html/a-cp/passwd"
Require valid-user
#----------------------------------------------------------------cp:ppd
# End section managed by cPanel: Password Protected Directories -cp:ppd
#----------------------------------------------------------------cp:ppd
<IfModule mod_rewrite.c>
    RewriteEngine On

    # ✅ منع إعادة التوجيه المكررة في هذا المجلد
    RewriteCond %{HTTP:X-Forwarded-Proto} !https
    RewriteRule ^(.*)$ https://%{HTTP_HOST}/a-cp/$1 [R=301,L]

    # ✅ التأكد من أن الطلب ليس لملف أو مجلد موجود
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    # ✅ السماح بالوصول إلى index.php داخل /a-cp/
    RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>
