<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /nis_ams/
    
    # Force correct domain - ADD THIS AT THE TOP
    RewriteCond %{HTTP_HOST} !^niscoreapps\.com\.ng$ [NC]
    RewriteRule ^(.*)$ https://niscoreapps.com.ng/nis_ams/$1 [L,R=301]
    
    # If the request is not for a valid file
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    # Rewrite to index.php
    RewriteRule ^(.*)$ index.php [L,QSA]
</IfModule>

# Prevent directory listing
Options -Indexes

# Set default character set
AddDefaultCharset UTF-8

# Enable compression
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/json
</IfModule>