# ============================================================
# phpGedView /zingo/
# Force HTTPS and set local cache policy.
# ============================================================

# ------------------------------------------------------------
# Force HTTPS
# ------------------------------------------------------------

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{HTTPS} !=on
    RewriteRule ^ https://jonsjonsgarden.com%{REQUEST_URI} [R=301,L]
</IfModule>


# ------------------------------------------------------------
# Static file caching
# Overrides the site's global no-cache policy for static files.
# PHP/HTML is intentionally left uncached.
# ------------------------------------------------------------

<IfModule mod_headers.c>

    # Static images: cache for 1 year
    <FilesMatch "\.(?i:jpe?g|png|gif|webp|avif|svg|ico)$">
        Header unset Pragma
        Header unset Expires
        Header set Cache-Control "public, max-age=31536000"
    </FilesMatch>

    # CSS and JavaScript: cache for 30 days
    <FilesMatch "\.(?i:css|js)$">
        Header unset Pragma
        Header unset Expires
        Header set Cache-Control "public, max-age=2592000"
    </FilesMatch>

    # Fonts: cache for 1 year
    <FilesMatch "\.(?i:woff2?|ttf|otf|eot)$">
        Header unset Pragma
        Header unset Expires
        Header set Cache-Control "public, max-age=31536000"
    </FilesMatch>

</IfModule>