forked from angular/code.angularjs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
66 lines (40 loc) · 1.72 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
Options +Indexes
IndexIgnore favicon.ico *.php robots.txt .git .gitignore
RewriteEngine on
RewriteCond %{HTTP_HOST} ^docs-next\.angularjs\.org$ [nc]
RewriteRule ^(.*)$ http://docs.angularjs.org/$1 [r=301,nc]
RewriteCond %{HTTP_HOST} ^angularjs\.com$ [nc]
RewriteRule ^(.*)$ http://angularjs.org/$1 [r=301,nc]
# Enable Crawling of AJAX apps.
# See: http://code.google.com/web/ajaxcrawling/docs/getting-started.html
RewriteCond %{QUERY_STRING} ^_escaped_fragment_=
RewriteRule ^(.*)$ /partials/$1.html
# Legacy: map /angular-X.Y.Z.js to /X.Y.Z/angular-X.Y.Z.js
RewriteRule ^angular([\-\w]+)(\d+\.\d+\.[\d\w\-]+)(.*)$ /$2/angular$1$2$3
# If the user has forgot the trailing slash than add it through redirect
RewriteRule ^latest$ /latest/ [R]
RewriteRule ^latest/docs$ /latest/docs/ [R]
# To change the latest version just change this line.
# IMPORTANT: the order of lines matters, do not move to top!
RewriteRule ^latest/(.*)$ /1.0.2/$1
# If the request comes on http://docs.angularjs.org then point it to snapshot/docs
RewriteCond %{HTTP_HOST} ^docs\.angularjs\.org(\:80)?$
RewriteRule ^(.*)$ /snapshot/docs/$1
## PERFORMANCE ##
ExpiresActive On
# cache js files for one year
<FilesMatch "^angular.*\.js$">
ExpiresDefault "access plus 1 year"
</FilesMatch>
# don't cache appcache manifests
<FilesMatch "\.manifest$">
ExpiresDefault "access"
</FilesMatch>
# cache everything else for 1h
ExpiresDefault "access plus 60 minutes"
# compression
SetOutputFilter DEFLATE
Header set Vary "Accept-Encoding"
# content types
AddType application/javascript js
AddType text/cache-manifest .manifest