htaccess: re-add custom htaccess blocking and caching rules
This commit is contained in:
parent
1c0a876a4e
commit
702483e599
38
.htaccess
38
.htaccess
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue