# Generated by integrations/apache-config.mjs. Do not edit the dist copy.
DirectoryIndex index.html
DirectorySlash Off
Options -Indexes -MultiViews
AddDefaultCharset UTF-8


RewriteEngine On
RewriteOptions AllowNoSlash

# Legacy URLs.


# Redirect explicit index requests only; internal DirectoryIndex requests must not loop.
RewriteCond %{THE_REQUEST} \s/+[^?\s]*index\.(?:html|php)(?:[/\s?]) [NC]
RewriteRule ^(.*?/)?index\.(?:html|php)/*$ https://ffortunica.com/$1 [R=301,L,NC]

# Static HTML directories, including pages added after the build.
RewriteCond %{REQUEST_FILENAME}/index.html -f
RewriteRule ^.*[^/]$ https://ffortunica.com%{REQUEST_URI}/ [R=301,L]

# Fixed destination host prevents Host-header-based redirects.
# HTTPS is read from Apache, not from an untrusted X-Forwarded-Proto header.
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://ffortunica.com%{REQUEST_URI} [R=301,L]

RewriteCond %{HTTP_HOST} !^ffortunica\.com$ [NC]
RewriteRule ^ https://ffortunica.com%{REQUEST_URI} [R=301,L]

# MIME-based fallback when mod_headers is unavailable.
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 month"
ExpiresByType text/html "access plus 0 seconds"
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType text/plain "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"
ExpiresByType image/gif "access plus 4 months"
ExpiresByType image/png "access plus 4 months"
ExpiresByType image/jpeg "access plus 4 months"
ExpiresByType image/webp "access plus 4 months"
ExpiresByType image/avif "access plus 4 months"
ExpiresByType image/svg+xml "access plus 4 months"
ExpiresByType image/x-icon "access plus 1 month"
ExpiresByType image/vnd.microsoft.icon "access plus 1 month"
ExpiresByType font/ttf "access plus 4 months"
ExpiresByType font/otf "access plus 4 months"
ExpiresByType font/woff "access plus 4 months"
ExpiresByType font/woff2 "access plus 4 months"
# Stable CSS/JS URLs must revalidate; only versioned files are immutable.
<FilesMatch "\.(css|js|mjs)$">
ExpiresDefault "access plus 0 seconds"
ExpiresByType text/css "access plus 0 seconds"
ExpiresByType application/javascript "access plus 0 seconds"
ExpiresByType text/javascript "access plus 0 seconds"
</FilesMatch>
<FilesMatch "^(?:_\.\.DFTnhK5_\.css)$">
ExpiresDefault "access plus 1 year"
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"
</FilesMatch>
</IfModule>

<IfModule mod_headers.c>
Header always set X-Content-Type-Options "nosniff"
<FilesMatch "\.(gif|png|jpe?g|webp|avif|svg|woff2?|ttf|otf)$">
Header set Cache-Control "public, max-age=10368000"
</FilesMatch>
<FilesMatch "\.ico$">
Header set Cache-Control "public, max-age=2592000"
</FilesMatch>
<FilesMatch "\.(html|xml|txt|json|css|js|mjs)$">
Header set Cache-Control "public, max-age=0, must-revalidate"
</FilesMatch>
<FilesMatch "^(?:_\.\.DFTnhK5_\.css)$">
Header set Cache-Control "public, max-age=31536000, immutable"
</FilesMatch>
</IfModule>

<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/css application/javascript application/xml image/svg+xml
</IfModule>
