# ATURA — konfigurasi Apache (shared hosting / cPanel)
Options -Indexes -MultiViews
<IfModule mod_rewrite.c>
RewriteEngine On
# folder sistem, berkas tersembunyi, dan berkas sensitif tidak pernah disajikan langsung
RewriteRule ^(app|storage|tools|docs)(/|$) - [F,L]
RewriteRule (^|/)\.(?!well-known/) - [F,L]
RewriteRule \.(sqlite|sqlite3|db|log|bak|old|orig|swp|sql|env|ini|lock|md|txt\.bak|dist|sh|command|zip|tgz|gz)$ - [F,L,NC]
RewriteRule ^(composer\.(json|lock)|package(-lock)?\.json|README\.md|CARA-PASANG-HOSTING\.txt|nginx\.conf)$ - [F,L,NC]
# hanya index.php & install/index.php yang boleh dijalankan sebagai PHP
RewriteCond %{REQUEST_URI} \.php$ [NC]
RewriteCond %{REQUEST_URI} !(^|/)index\.php$ [NC]
RewriteCond %{REQUEST_URI} !/install/index\.php$ [NC]
RewriteRule ^ - [F,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^ index.php [L]
</IfModule>
<IfModule mod_headers.c>
Header always set X-Content-Type-Options "nosniff"
Header always set X-Frame-Options "SAMEORIGIN"
Header always set Referrer-Policy "strict-origin-when-cross-origin"
Header always set Permissions-Policy "camera=(self), geolocation=(self), microphone=(), payment=(self), usb=()"
Header always set X-Permitted-Cross-Domain-Policies "none"
Header always unset X-Powered-By
Header unset X-Powered-By
</IfModule>
<FilesMatch "\.(sqlite|sqlite3|db|log|bak|sql|env|ini|md|command|sh|zip|tgz|gz|conf)$">
Require all denied
</FilesMatch>
<Files "CARA-PASANG-HOSTING.txt">
Require all denied
</Files>
# Server tanpa mod_rewrite (mis. MAMP bawaan): halaman tetap dialihkan ke index.php.
# Bila aplikasi dipasang di subfolder, ganti "/index.php" menjadi "/nama-folder/index.php".
<IfModule !mod_rewrite.c>
DirectoryIndex index.php
FallbackResource /index.php
</IfModule>
