Options -Indexes
RewriteEngine On

# -----------------------------------------------
# FORCE HTTPS
# -----------------------------------------------
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

# -----------------------------------------------
# GEO-REDIRECT (Nigeria + USA → /your-target-page/)
# -----------------------------------------------

# Don't redirect the geo-redirect.php file itself (prevents infinite loop)
RewriteCond %{REQUEST_URI} !^/geo-redirect\.php [NC]

# Don't redirect actual files or folders that exist on the server
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Send all homepage/root traffic through the geo redirect script
RewriteRule ^$ /geo-redirect.php [L]
