2016-03-28 20:44:06 +00:00
|
|
|
# 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
|
2016-12-12 23:00:38 +00:00
|
|
|
# except for requests to plugin assets files
|
|
|
|
#RewriteRule ^assets/plugins/([a-zA-Z0-9\.\-_%=]+)/(.*)$ site/plugins/$1/assets/$2 [L,N]
|
|
|
|
#RewriteCond $1 !^plugins/[a-zA-Z0-9\.\-_%=]+/assets/.*
|
2016-03-28 20:44:06 +00:00
|
|
|
RewriteRule ^site/(.*) index.php [L]
|
|
|
|
|
2016-12-12 23:00:38 +00:00
|
|
|
# block direct access to kirby and the panel sources
|
|
|
|
RewriteRule ^(kirby|panel\/app|panel\/tests)/(.*) index.php [L]
|
2016-03-28 20:44:06 +00:00
|
|
|
|
|
|
|
# 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"
|
2016-05-21 21:20:16 +00:00
|
|
|
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"
|
2016-03-28 20:44:06 +00:00
|
|
|
</IfModule>
|