关于此工具
Apache:强制 HTTPS、SPA 回退到 index.html、gzip 及静态资源长缓存。
开箱即用的 .htaccess——查看内容、复制,或以正确的文件名下载。免费,100% 在浏览器中运行。
Apache:强制 HTTPS、SPA 回退到 index.html、gzip 及静态资源长缓存。
# Force HTTPS
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# SPA fallback — send unknown paths to index.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.html [L]
# Gzip
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/css application/javascript application/json image/svg+xml
</IfModule>
# Cache static assets for a year
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 month"
</IfModule>
Apache:强制 HTTPS、SPA 回退到 index.html、gzip 及静态资源长缓存。
开箱即用的 .htaccess——查看内容、复制,或以正确的文件名下载。免费,100% 在浏览器中运行。