﻿# BBPPMT CMS - pretty URL (aman untuk folder/aplikasi lain di public_html)
DirectoryIndex index.php

<IfModule mod_rewrite.c>
RewriteEngine On

# Jangan rewrite URL milik Let's Encrypt / cgi-bin / aplikasi lain
RewriteCond %{REQUEST_URI} !^/\.well-known/
RewriteCond %{REQUEST_URI} !^/cgi-bin(/|$)
RewriteCond %{REQUEST_URI} !^/(bbppmyk\.id|inovasibalai\.bbppmyk\.id|kepegawaian\.bbppmyk\.id|resepsionis\.bbppmyk\.id|skm\.bbppmyk\.id|transmigrasi\.bbppmyk\.id)(/|$) [NC]

# Hanya URL yang bukan file/folder nyata yang diarahkan ke front controller
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]
</IfModule>

# Lindungi file internal (config.php & router.php hanya untuk lokal)
<IfModule mod_authz_core.c>
<FilesMatch "^(config\.php|router\.php)$">
Require all denied
</FilesMatch>
</IfModule>
<IfModule !mod_authz_core.c>
<FilesMatch "^(config\.php|router\.php)$">
Deny from all
</FilesMatch>
</IfModule>
