diff --git a/.htaccess b/.htaccess index ec6924b2..7d74951a 100644 --- a/.htaccess +++ b/.htaccess @@ -4,3 +4,55 @@ RewriteCond %{HTTP_HOST} ^msos\.spletnimojster\.si$ [OR] RewriteCond %{HTTP_HOST} ^www\.msos\.spletnimojster\.si$ RewriteRule ^/?$ "https\:\/\/msos\.spletnimojster\.si\/en\/" [R=301,L] + +# ============================================================ +# Static-site defaults (added for SEO / performance / 404). +# Wrapped in guards so a missing module can't 500. +# Ignored by nginx (harmless). No extra HTTPS/host redirects — +# the host handles TLS and the rule above handles the root. +# ============================================================ + +# ----- Custom branded error page ----- +ErrorDocument 404 /404.html + +# ----- Don't expose directory listings ----- +Options -Indexes + +# ----- Correct MIME types (WebP, SVG, manifest, fonts) ----- + + AddType image/webp .webp + AddType image/svg+xml .svg + AddType application/manifest+json .webmanifest + AddType image/x-icon .ico + AddType font/woff2 .woff2 + + +# ----- Gzip / compression for text assets ----- + + AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml + AddOutputFilterByType DEFLATE application/javascript application/json + AddOutputFilterByType DEFLATE application/xml application/manifest+json + AddOutputFilterByType DEFLATE image/svg+xml + + +# ----- Browser caching ----- +# No file-hashing on this site, so keep CSS/JS short (updates must propagate) +# and cache images/fonts longer. HTML is always revalidated. + + ExpiresActive On + ExpiresByType text/html "access plus 0 seconds" + ExpiresByType text/css "access plus 1 day" + ExpiresByType application/javascript "access plus 1 day" + ExpiresByType image/webp "access plus 1 month" + ExpiresByType image/jpeg "access plus 1 month" + ExpiresByType image/png "access plus 1 month" + ExpiresByType image/svg+xml "access plus 1 month" + ExpiresByType image/x-icon "access plus 1 month" + ExpiresByType font/woff2 "access plus 1 month" + + + Header set X-Content-Type-Options "nosniff" + + Header set Cache-Control "no-cache, must-revalidate" + +