|
| 1 | +Options +Indexes |
| 2 | +IndexIgnore favicon.ico |
| 3 | +RewriteEngine on |
| 4 | + |
| 5 | +# Enable Crawling of AJAX apps. |
| 6 | +# See: http://code.google.com/web/ajaxcrawling/docs/getting-started.html |
| 7 | +RewriteCond %{QUERY_STRING} ^_escaped_fragment_=\/(.*)$ |
| 8 | +RewriteRule ^(.*)$ /$1/%1.html? |
| 9 | + |
| 10 | +# Map versiond angular files to root folder. |
| 11 | +RewriteRule ^angular([\-\w]+)(\d+\.\d+\.\d+)(.*)$ /$2/angular$1$2$3 |
| 12 | +# Map 1.2.3/docs to 1.2.3/docs-1.2.3/ so that we don't need the version in the URL twice |
| 13 | +RewriteRule ^(\d+\.\d+\.\d+)/docs/(.*)$ /$1/docs-$1/$2 |
| 14 | + |
| 15 | +# If the user has forgot the trailing slash than add it through redirect |
| 16 | +RewriteRule ^latest$ /latest/ [R] |
| 17 | +RewriteRule ^latest/docs$ /latest/docs/ [R] |
| 18 | + |
| 19 | +# To change the latest version just change this line. |
| 20 | +# IMPORTANT: the order of lines matters, do not move to top! |
| 21 | +RewriteRule ^latest/(.*)$ /0.9.17/$1 |
| 22 | + |
| 23 | +# If the request comes on http://docs.angularjs.org then point it to latest/docs |
| 24 | +RewriteCond %{HTTP_HOST} ^docs\.angularjs\.org$ |
| 25 | +RewriteCond %{REQUEST_URI} !^/\d+\.\d+\.\d+ |
| 26 | +RewriteCond %{REQUEST_URI} !^/latest |
| 27 | +RewriteCond %{REQUEST_URI} !^/angular- |
| 28 | +RewriteCond %{REQUEST_URI} !^/favicon.ico |
| 29 | +RewriteRule ^(.*)$ /latest/docs/$1 |
| 30 | + |
| 31 | +## PERFORMANCE ## |
| 32 | + |
| 33 | +ExpiresActive On |
| 34 | + |
| 35 | +# cache js files for one year |
| 36 | +<FilesMatch "^angular-(ie-compat-)?[\d\.]+(\.min)?\.js"> |
| 37 | +ExpiresDefault "access plus 1 year" |
| 38 | +</FilesMatch> |
| 39 | + |
| 40 | +# don't cache appcache manifests |
| 41 | +<FilesMatch "\.manifest$"> |
| 42 | +ExpiresDefault "access" |
| 43 | +</FilesMatch> |
| 44 | + |
| 45 | +# cache everything else for 1h |
| 46 | +ExpiresDefault "access plus 60 minutes" |
| 47 | + |
| 48 | + |
| 49 | +# compression |
| 50 | +SetOutputFilter DEFLATE |
| 51 | +Header set Vary "Accept-Encoding" |
| 52 | + |
| 53 | + |
| 54 | +# content types |
| 55 | +AddType application/javascript js |
| 56 | +AddType text/cache-manifest .manifest |
| 57 | + |
0 commit comments