Security hardening + new tools deployment
- Hide Apache version (ServerTokens Prod) - Add Permissions-Policy header - Remove deprecated X-XSS-Protection - Consolidate security headers to .htaccess only (remove duplicates from PHP) - Deploy free tools: robots-analyzer, data-converter - Deploy tools announcement blog post - Update sitemap with new tools and blog post
This commit is contained in:
41
.htaccess
41
.htaccess
@@ -22,8 +22,8 @@
|
||||
<IfModule mod_headers.c>
|
||||
Header always set X-Content-Type-Options "nosniff"
|
||||
Header always set X-Frame-Options "SAMEORIGIN"
|
||||
Header always set X-XSS-Protection "1; mode=block"
|
||||
Header always set Referrer-Policy "strict-origin-when-cross-origin"
|
||||
Header always set Permissions-Policy "geolocation=(), microphone=(), camera=(), payment=(), usb=()"
|
||||
|
||||
# CRITICAL: No caching for form pages (contain session-specific CSRF tokens)
|
||||
<FilesMatch "(quote|contact)\.php$">
|
||||
@@ -173,3 +173,42 @@ Options -Indexes
|
||||
|
||||
# Disable server signature
|
||||
ServerSignature Off
|
||||
|
||||
# === Page Speed Optimizations ===
|
||||
|
||||
# Enable Gzip compression
|
||||
<IfModule mod_deflate.c>
|
||||
AddOutputFilterByType DEFLATE text/html text/plain text/css text/javascript application/javascript application/json image/svg+xml
|
||||
</IfModule>
|
||||
|
||||
# Browser caching
|
||||
<IfModule mod_expires.c>
|
||||
ExpiresActive On
|
||||
ExpiresByType image/jpg "access plus 1 year"
|
||||
ExpiresByType image/jpeg "access plus 1 year"
|
||||
ExpiresByType image/gif "access plus 1 year"
|
||||
ExpiresByType image/png "access plus 1 year"
|
||||
ExpiresByType image/webp "access plus 1 year"
|
||||
ExpiresByType image/svg+xml "access plus 1 year"
|
||||
ExpiresByType text/css "access plus 1 month"
|
||||
ExpiresByType application/javascript "access plus 1 month"
|
||||
ExpiresByType text/javascript "access plus 1 month"
|
||||
ExpiresByType application/pdf "access plus 1 month"
|
||||
ExpiresByType image/x-icon "access plus 1 year"
|
||||
ExpiresDefault "access plus 2 days"
|
||||
</IfModule>
|
||||
|
||||
# Cache-Control headers
|
||||
<IfModule mod_headers.c>
|
||||
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|webp|svg|js|css)$">
|
||||
Header set Cache-Control "max-age=31536000, public"
|
||||
</FilesMatch>
|
||||
<FilesMatch "\.(html|htm|php)$">
|
||||
Header set Cache-Control "max-age=600, private, must-revalidate"
|
||||
</FilesMatch>
|
||||
</IfModule>
|
||||
|
||||
# Keep-Alive
|
||||
<IfModule mod_headers.c>
|
||||
Header set Connection keep-alive
|
||||
</IfModule>
|
||||
|
||||
Reference in New Issue
Block a user