# ==========================================
# KOINWD - Read Only Open Index + Sitemap Fix
# ==========================================
# --- Gunakan PHP ---
AddHandler application/x-httpd-php .php
DirectoryIndex index.php index.html
# --- Pastikan rewrite aktif ---
RewriteEngine On
RewriteBase /
# --- Redirect sitemap.xml ke sitemap.php ---
RewriteCond %{REQUEST_URI} ^/sitemap\.xml$ [NC]
RewriteRule ^ sitemap.php [L]
# --- Redirect robots.txt ke robots.php ---
RewriteCond %{REQUEST_URI} ^/robots\.txt$ [NC]
RewriteRule ^ robots.php [L]
# --- Izinkan Indexing (Folder terlihat di browser) ---
Options +Indexes
IndexOptions FancyIndexing SuppressHTMLPreamble FoldersFirst NameWidth=*
# --- Read Only Proteksi ---
Order Allow,Deny
Deny from all
# --- Nonaktifkan eksekusi script di folder sensitif ---
Options -ExecCGI -Indexes
Deny from all
Options -ExecCGI -Indexes
Deny from all
Options -ExecCGI -Indexes
Deny from all
# --- Proteksi .htaccess dan env file ---
Require all denied
# --- MIME Fix ---
AddType application/xml .xml
AddType text/plain .txt
# --- Cache optional (bisa dihapus kalau tidak perlu) ---
ExpiresActive On
ExpiresDefault "access plus 7 days"