1
0
Fork 0

[GIT] add .htaccess

This commit is contained in:
Jannik Beyerstedt 2016-03-28 22:44:06 +02:00
parent 46b0df0faf
commit 7012f94ee1

76
.htaccess Normal file
View file

@ -0,0 +1,76 @@
# Kirby .htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
# block text files in the content folder from being accessed directly
RewriteRule ^content/(.*)\.(txt|md|mdown)$ index.php [L]
# block all files in the site folder from being accessed directly
RewriteRule ^site/(.*) index.php [L]
# block all files in the kirby folder from being accessed directly
RewriteRule ^kirby/(.*) index.php [L]
# make panel links work
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^panel/(.*) panel/index.php [L]
# make site links work
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]
</IfModule>
# block update scripts
RewriteRule ^(.*).sh$ error [R=301,L]
# enable gzip compressed transfer
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
<IfModule mod_setenvif.c>
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# Don't compress images
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
</IfModule>
<IfModule mod_headers.c>
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</IfModule>
</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 seconds"
ExpiresByType text/xml "access plus 1 hours"
ExpiresByType text/css "access plus 4 weeks"
ExpiresByType image/gif "access plus 4 weeks"
ExpiresByType image/jpeg "access plus 4 weeks"
ExpiresByType image/png "access plus 4 weeks"
ExpiresByType image/svg+xml "access plus 4 weeks"
ExpiresByType text/javascript "access plus 4 weeks"
ExpiresByType application/x-javascript "access plus 4 weeks"
ExpiresByType application/vnd.ms-fontobject "access plus 4 weeks"
ExpiresByType application/x-font-opentype "access plus 4 weeks"
ExpiresByType application/x-font-ttf "access plus 4 weeks"
ExpiresByType application/font-woff "access plus 4 weeks"
</IfModule>