/
.htaccess
173 lines (133 loc) · 5.78 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
Options -Indexes
ErrorDocument 404 /404.html
ErrorDocument 403 /403.html
AddType text/cache-manifest .appcache
AddType application/font-woff2 .woff2
AddType application/font-woff .woff
AddType application/javascript .js
AddDefaultCharset utf-8
<IfModule mod_mime.c>
AddCharset utf-8 .atom \
.bbaw \
.css \
.geojson \
.js \
.json \
.jsonld \
.manifest \
.rdf \
.rss \
.topojson \
.vtt \
.webapp \
.webmanifest \
.xloc \
.xml
</IfModule>
# ----------------------------------------------------------------------
# Expires headers (for better cache control)
# ----------------------------------------------------------------------
# These are pretty far-future expires headers.
# They assume you control versioning with filename-based cache busting
# Additionally, consider that outdated proxies may miscache
# www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
# If you don't use filenames to version, lower the CSS and JS to something like
# "access plus 1 week".
<IfModule mod_expires.c>
ExpiresActive on
# Perhaps better to whitelist expires rules? Perhaps.
ExpiresDefault "access plus 1 month"
# cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
ExpiresByType text/cache-manifest "access plus 0 seconds"
# Your document html
ExpiresByType text/html "access plus 0 seconds"
# Data
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"
# Feed
ExpiresByType application/rss+xml "access plus 1 hour"
ExpiresByType application/atom+xml "access plus 1 hour"
# Favicon (cannot be renamed)
ExpiresByType image/x-icon "access plus 1 week"
# Media: images, video, audio
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType audio/ogg "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"
# HTC files (css3pie)
ExpiresByType text/x-component "access plus 1 month"
# Webfonts
ExpiresByType application/x-font-ttf "access plus 1 year"
ExpiresByType font/opentype "access plus 1 year"
ExpiresByType application/x-font-woff "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
ExpiresByType application/font-woff "access plus 1 year"
ExpiresByType application/x-font-woff2 "access plus 1 year"
ExpiresByType application/font-woff2 "access plus 1 year"
# CSS and JavaScript
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
</IfModule>
<IfModule mod_deflate.c>
AddOutputFilter DEFLATE js css html
</IfModule>
# Force Internet Explorer to render pages in the highest available
# mode in the various cases when it may not.
# https://hsivonen.fi/doctype/#ie8
<IfModule mod_headers.c>
Header set X-UA-Compatible "IE=edge"
Header set Cache-Control "no-transform"
Header set Strict-Transport-Security "max-age=15552000" env=HTTPS
Header set X-Content-Type-Options "nosniff"
Header set X-Frame-Options "SAMEORIGIN"
Header set X-XSS-Protection "1; mode=block"
Header set Timing-Allow-Origin "*"
Header set Content-Security-Policy "{CSP}"
# `mod_headers` cannot match based on the content-type, however, this header
# should be send only for HTML documents and not for the other resources
<FilesMatch "\.(appcache|atom|crx|css|cur|eot|f4[abpv]|flv|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|tt[cf]|txt|vcf|vtt|webapp|web[mp]|woff|xml|xpi)$">
Header unset X-UA-Compatible
</FilesMatch>
<FilesMatch "\.(html|eot|otf|tt[cf]|woff2?)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
Header unset X-Powered-By
Header unset Server
Header unset ETag
{PUSHES}
</IfModule>
FileETag None
ServerSignature Off
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} ^(www\.)?comandeer\.pl [NC]
RewriteCond %{HTTPS} !=on
RewriteRule ^$ https://www.comandeer.pl/ [R=301,L]
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} ^(www\.)?comandeer\.pl [NC]
RewriteCond %{HTTPS} !=on
RewriteRule ^(.+)$ https://www.comandeer.pl/$1 [R=301,L]
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} ^comandeer\.pl [NC]
RewriteCond %{HTTPS} =on
RewriteRule ^$ https://www.comandeer.pl/ [R=301,L]
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} ^comandeer\.pl [NC]
RewriteCond %{HTTPS} =on
RewriteRule ^(.+)$ https://www.comandeer.pl/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^.*/index\.(php|html|htm)
RewriteRule ^(.*)index.(php|html|htm)$ /$1 [R=301,L]
RewriteRule ^o_mnie.html$ /o-mnie.html [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.comandeer\.pl [NC,OR]
RewriteCond %{HTTP_HOST} ^comandeer\.pl [NC]
RewriteRule ^tutorials/(.*)$ http://tutorials.comandeer.pl/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.comandeer\.pl [NC,OR]
RewriteCond %{HTTP_HOST} ^comandeer\.pl [NC]
RewriteRule ^tutorials$ http://tutorials.comandeer.pl [R=301,L]