forked from jsdelivr/bootstrapcdn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
49 lines (37 loc) · 1.58 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
# php in HTML are you nuts? Yup.
AddType application/x-httpd-php .html
AddType application/x-httpd-php .inc
# Tell the origin what json is
AddType application/json .json
# Cache everything on for 1 year.
# We are making an 24 hour exception for json since we are using it for the daily stats and need that $#!+ fresh
Header append Cache-Control "public, must-revalidate, proxy-revalidate"
ExpiresActive On
ExpiresByType text/css A31536000
ExpiresByType application/javascript A31536000
ExpiresByType image/png A31536000
ExpiresByType image/gif A31536000
ExpiresByType application/json A86400
ExpiresByType text/html A21600
# This will allow us to point www to the CDN so each page is cached globally.
RewriteEngine On
IndexIgnore *
Options +FollowSymLinks -Multiviews -Indexes
RewriteCond %{HTTP_HOST} ^bootstrapcdn\.com$ [NC]
RewriteRule ^(.*)$ http://www.bootstrapcdn.com/$1?v=01222013095352 [R=302,L]
# A million dollars isn't cool, adding your own custom headers is. That's how it went right?
Header set X-Powered-By "NetDNA - The Science of Acceleration™"
Header set X-Hello-Human "You must be bored. You should work for us. Email jdorfman+theheader@netdna.com or @NetDNADeveloper on the twitter"
# Vary Important - http://stackoverflow.com/a/14541454/1258484
<FilesMatch "\.(js|css|xml|gz|ttf|eot|woff|json|html)$">
Header append Vary: Accept-Encoding
</FilesMatch>
# Allow fonts to be downloaded to Firefox & IE
<FilesMatch ".(ttf|eot|woff)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
#Prevent viewing of .htaccess file
<Files .htaccess>
order allow,deny
deny from all
</Files>