# Written by Site Recovery.
DirectoryIndex index.html
ErrorDocument 404 /404.html

# One address for the site: https://www.gsolsolar.com
<IfModule mod_rewrite.c>
    RewriteEngine On
    # http → https (also behind a proxy or Cloudflare that sends X-Forwarded-Proto)
    RewriteCond %{HTTPS} !=on
    RewriteCond %{HTTP:X-Forwarded-Proto} !=https
    RewriteRule ^ https://www.gsolsolar.com%{REQUEST_URI} [L,R=301]
    # the other host (www or without) → this one
    RewriteCond %{HTTP_HOST} !^www\.gsolsolar\.com$ [NC]
    RewriteRule ^ https://www.gsolsolar.com%{REQUEST_URI} [L,R=301]
</IfModule>
