-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
66 lines (46 loc) · 1.69 KB
/
.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Kirby .htaccess
Header add Access-Control-Allow-Origin "*"
# rewrite rules
<IfModule mod_rewrite.c>
# enable awesome urls. i.e.: http://yourdomain.com/about-us/team
RewriteEngine on
RewriteBase /
# block text files in the content folder from being accessed directly
RewriteRule ^content/(.*)\.(txt|md|mdown)$ error [R=301,L]
# block all files in the site folder from being accessed directly
RewriteRule ^site/(.*) error [R=301,L]
# block all files in the kirby folder from being accessed directly
RewriteRule ^kirby/(.*) error [R=301,L]
# leave robots.txt alone for search engines
RewriteRule ^robots.txt robots.txt [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>
# GZIP Compression for supported servers
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
# Leverage browser caching (1 week from access date)
<ifModule mod_expires.c>
ExpiresDefault "access plus 1 week"
<FilesMatch "\.(html|js|css|png|ico|jpg|jpeg|eot|svg|ttf|woff)$">
Header set Cache-Control "max-age=604800, public, must-revalidate"
</FilesMatch>
</ifModule>
# Additional recommended values, remove comments for those you want to use.
#
# AddDefaultCharset UTF-8
# php_flag short_open_tag on