이 도구에 대해
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% 브라우저에서.