# OJT Management System - web root (public_html)
Options -Indexes
DirectoryIndex index.php

<IfModule mod_rewrite.c>
RewriteEngine On

# Force HTTPS: UNCOMMENT these 3 lines once SSL (AutoSSL) is active for the domain.
#RewriteCond %{HTTPS} !=on
#RewriteCond %{HTTP:X-Forwarded-Proto} !https
#RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Never serve the loader, dotfiles (except .well-known for AutoSSL) or data/backup files
RewriteRule ^_loader\.php$ - [F,L]
RewriteCond %{REQUEST_URI} !^/\.well-known/
RewriteRule (^|/)\. - [F,L]
RewriteRule \.(sql|log|env|ini|bak|old|md|zip|sh)$ - [F,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"
</IfModule>
