|
1 |
| -# ---------------------------------------------------------------------- |
| 1 | +# ----------------------- |
2 | 2 | # Kirby URL rewrite rules
|
3 |
| -# ---------------------------------------------------------------------- |
| 3 | +# ----------------------- |
4 | 4 | <IfModule mod_rewrite.c>
|
5 | 5 | RewriteEngine on
|
6 | 6 | RewriteBase /
|
|
10 | 10 | RewriteCond %{HTTPS} !=on
|
11 | 11 | RewriteCond %{HTTP_HOST} !^bradshawsguide\.dev$ [NC]
|
12 | 12 | RewriteCond %{HTTP_HOST} !^bradshawsguide\.org$ [NC]
|
13 |
| - RewriteCond %{HTTP_HOST} !^static\.bradshawsguide\.org$ [NC] |
14 | 13 | RewriteRule ^(.*)$ http://bradshawsguide.org/$1 [R=301,L]
|
15 | 14 |
|
16 | 15 | # Rewrite cache busting query strings on static files
|
|
22 | 21 | RewriteCond %{REQUEST_FILENAME} !-d
|
23 | 22 | RewriteRule ^(.*) index.php [L]
|
24 | 23 |
|
25 |
| -# Make panel links work |
26 |
| - RewriteCond %{REQUEST_FILENAME} !-f |
27 |
| - RewriteCond %{REQUEST_FILENAME} !-d |
28 |
| - RewriteRule ^panel/(.*) panel/index.php [L] |
29 |
| - |
30 | 24 | # Block text files in the content folder from being accessed directly
|
31 | 25 | RewriteRule ^content/(.*)\.(txt|md|mdown)$ error [R=301,L]
|
32 | 26 |
|
|
38 | 32 | </IfModule>
|
39 | 33 |
|
40 | 34 |
|
41 |
| -# ---------------------------------------------------------------------- |
| 35 | +# -------------- |
42 | 36 | # UTF-8 Encoding
|
43 |
| -# ---------------------------------------------------------------------- |
| 37 | +# -------------- |
44 | 38 | # Use utf-8 encoding for anything served text/plain or text/html
|
45 | 39 | AddDefaultCharset utf-8
|
46 | 40 |
|
47 | 41 | # Force utf-8 for a number of file formats
|
48 | 42 | AddCharset utf-8 .html .php .css .js .xml .json .rss
|
49 | 43 |
|
50 | 44 |
|
51 |
| -# ---------------------------------------------------------------------- |
| 45 | +# ------------ |
52 | 46 | # PHP Settings
|
53 |
| -# ---------------------------------------------------------------------- |
| 47 | +# ------------ |
54 | 48 | <IfModule php5_module>
|
55 | 49 | # Use php5
|
56 | 50 | AddHandler php5-script .php
|
|
63 | 57 | </IfModule>
|
64 | 58 |
|
65 | 59 |
|
66 |
| -# ---------------------------------------------------------------------- |
67 |
| -# Better website experience for IE users |
68 |
| -# ---------------------------------------------------------------------- |
69 |
| -# Force the latest IE version, in various cases when it may fall back to IE7 mode |
70 |
| -# Use ChromeFrame if it's installed for a better experience for the poor IE folk |
71 |
| - |
72 |
| -<IfModule mod_headers.c> |
73 |
| - Header set X-UA-Compatible "IE=Edge,chrome=1" |
74 |
| - <FilesMatch "\.(js|css|gif|png|jpe?g|pdf|xml|oga|ogg|m4a|ogv|mp4|m4v|webm|svg|svgz|eot|ttf|otf|woff|ico|webp|appcache|manifest|htc|crx|xpi|safariextz|vcf)$" > |
75 |
| - # mod_headers can't match by content-type, but we don't want to send this header on everything... |
76 |
| - Header unset X-UA-Compatible |
77 |
| - </FilesMatch> |
78 |
| -</IfModule> |
79 |
| - |
80 |
| - |
81 |
| -# ---------------------------------------------------------------------- |
| 60 | +# ------------------------------ |
82 | 61 | # Proper MIME type for all files
|
83 |
| -# ---------------------------------------------------------------------- |
| 62 | +# ------------------------------ |
84 | 63 | # Images
|
85 |
| - AddType image/x-icon ico |
86 |
| - AddType image/webp webp |
87 |
| - AddType image/svg+xml svg |
| 64 | + AddType image/svg+xml svg |
88 | 65 |
|
89 | 66 | # Other
|
90 |
| - AddType application/javascript js |
91 |
| - AddType application/atom+xml xml |
92 |
| - AddType application/opensearchdescription+xml xml |
93 |
| - AddType application/x-font-ttf ttf |
| 67 | + AddType application/javascript js |
| 68 | + AddType application/x-font-ttf ttf |
94 | 69 |
|
95 | 70 |
|
96 |
| -# ---------------------------------------------------------------------- |
| 71 | +# ----------- |
97 | 72 | # Performance
|
98 |
| -# ---------------------------------------------------------------------- |
| 73 | +# ----------- |
99 | 74 | <IfModule mod_headers.c>
|
100 |
| -# FileETag None is not enough for every server. |
| 75 | +# FileETag None is not enough for every server |
101 | 76 | Header unset ETag
|
102 | 77 | </IfModule>
|
103 | 78 |
|
104 |
| -# Since we're sending far-future expires, we don't need ETags for static content. |
| 79 | +# Since we're sending far-future expires, we don't need ETags for static content |
105 | 80 | FileETag None
|
106 | 81 |
|
107 | 82 | <IfModule mod_expires.c>
|
108 | 83 | # Set expires headers
|
109 | 84 | ExpiresActive on
|
110 |
| - |
111 |
| -# Perhaps better to whitelist expires rules? Perhaps. |
112 |
| - ExpiresDefault "access plus 1 day" |
| 85 | + ExpiresDefault "access plus 1 day" |
113 | 86 |
|
114 | 87 | # HTML
|
115 |
| - ExpiresByType text/html "access plus 10 minutes" |
116 |
| - |
117 |
| -# Data |
118 |
| - ExpiresByType text/xml "access plus 0 seconds" |
119 |
| - ExpiresByType application/xml "access plus 0 seconds" |
120 |
| - |
121 |
| -# RSS feeds |
122 |
| - ExpiresByType application/rss+xml "access plus 1 hour" |
123 |
| - ExpiresByType application/atom+xml "access plus 1 hour" |
124 |
| - |
125 |
| -# Favicon (cannot be renamed) |
126 |
| - ExpiresByType image/x-icon "access plus 1 month" |
| 88 | + ExpiresByType text/html "access plus 10 minutes" |
127 | 89 |
|
128 | 90 | # Images
|
129 |
| - ExpiresByType image/png "access plus 1 month" |
130 |
| - ExpiresByType image/jpeg "access plus 1 month" |
131 |
| - |
132 |
| -# Web fonts |
133 |
| - ExpiresByType application/x-font-ttf "access plus 1 month" |
| 91 | + ExpiresByType image/png "access plus 1 month" |
| 92 | + ExpiresByType image/jpeg "access plus 1 month" |
134 | 93 |
|
135 | 94 | # CSS and JavaScript
|
136 |
| - ExpiresByType text/css "access plus 1 year" |
137 |
| - ExpiresByType application/javascript "access plus 1 year" |
| 95 | + ExpiresByType text/css "access plus 1 year" |
| 96 | + ExpiresByType application/javascript "access plus 1 year" |
| 97 | + |
| 98 | +# Web fonts |
| 99 | + ExpiresByType application/x-font-ttf "access plus 1 month" |
138 | 100 | </IfModule>
|
139 | 101 |
|
140 | 102 |
|
141 |
| -# ---------------------------------------------------------------------- |
| 103 | +# ---------------- |
142 | 104 | # GZIP Compression
|
143 |
| -# ---------------------------------------------------------------------- |
| 105 | +# ---------------- |
144 | 106 | <IfModule mod_deflate.c>
|
145 | 107 | # Force deflate for mangled headers
|
146 | 108 | <IfModule mod_setenvif.c>
|
|
151 | 113 | </IfModule>
|
152 | 114 |
|
153 | 115 | # Compress all output labeled with one of the following MIME-types
|
154 |
| - AddOutputFilterByType DEFLATE application/atom+xml \ |
155 |
| - application/javascript \ |
156 |
| - application/rss+xml \ |
157 |
| - application/xhtml+xml \ |
158 |
| - application/xml \ |
| 116 | + AddOutputFilterByType DEFLATE application/javascript \ |
159 | 117 | application/x-font-ttf \
|
160 | 118 | image/svg+xml \
|
161 |
| - image/x-icon \ |
162 | 119 | text/css \
|
163 | 120 | text/html \
|
164 | 121 | text/plain \
|
|
0 commit comments