1
0
Fork 0

htaccess: re-add custom htaccess blocking and caching rules

This commit is contained in:
Jannik Beyerstedt 2021-01-24 19:59:29 +01:00
parent 1c0a876a4e
commit 702483e599

View file

@ -55,3 +55,41 @@ AddOutputFilterByType DEFLATE application/json
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>
## Custom htaccess
<IfModule mod_rewrite.c>
# block update scripts
RewriteRule ^(.*).sh$ error [R=301,L]
# block git repo
RewriteRule ^.git/(.*) error [R=301,L]
RewriteRule ^.gitattributes error [R=301,L]
RewriteRule ^.gitignore error [R=301,L]
RewriteRule ^.gitmodules error [R=301,L]
</IfModule>
# enable browser caching headers
AddType image/svg+xml .svg
AddType application/vnd.ms-fontobject .eot
AddType application/x-font-opentype .otf
AddType application/x-font-ttf .ttf
AddType application/font-woff .woff
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType text/html "access plus 1 hour"
ExpiresByType text/xml "access plus 1 hour"
ExpiresByType text/css "access plus 1 month"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
ExpiresByType application/x-font-opentype "access plus 1 year"
ExpiresByType application/x-font-ttf "access plus 1 year"
ExpiresByType application/font-woff "access plus 1 year"
</IfModule>