|
| 1 | +Options +Indexes |
| 2 | +IndexIgnore favicon.ico |
| 3 | +RewriteEngine on |
| 4 | + |
| 5 | +RewriteCond %{HTTP_HOST} ^docs-next\.angularjs\.org$ [nc] |
| 6 | +RewriteRule ^(.*)$ http://docs.angularjs.org/$1 [r=301,nc] |
| 7 | + |
| 8 | + |
| 9 | +RewriteCond %{HTTP_HOST} ^angularjs\.com$ [nc] |
| 10 | +RewriteRule ^(.*)$ http://angularjs.org/$1 [r=301,nc] |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | +# Enable Crawling of AJAX apps. |
| 15 | +# See: http://code.google.com/web/ajaxcrawling/docs/getting-started.html |
| 16 | +RewriteCond %{QUERY_STRING} ^_escaped_fragment_=\/(.*)$ |
| 17 | +RewriteRule ^(.*)$ /$1/%1.html? |
| 18 | + |
| 19 | +# Map versiond angular files to root folder. |
| 20 | +RewriteRule ^angular([\-\w]+)(\d+\.\d+\.[\d\w\-]+)(.*)$ /$2/angular$1$2$3 |
| 21 | +# 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 |
| 22 | +RewriteRule ^(\d+\.\d+\.[\d\w]+)/docs/(.*)$ /$1/docs-$1/$2 |
| 23 | + |
| 24 | +# If the user has forgot the trailing slash than add it through redirect |
| 25 | +RewriteRule ^latest$ /latest/ [R] |
| 26 | +RewriteRule ^latest/docs$ /latest/docs/ [R] |
| 27 | + |
| 28 | +# To change the latest version just change this line. |
| 29 | +# IMPORTANT: the order of lines matters, do not move to top! |
| 30 | +#RewriteRule ^latest/(.*?)((?:\.min)?\.js)$ /1.0.1/$1-1.0.1$2 |
| 31 | +RewriteRule ^latest/(.*)$ /1.0.1/$1 |
| 32 | + |
| 33 | +# If the request comes on http://docs.angularjs.org then point it to latest/docs |
| 34 | +RewriteCond %{HTTP_HOST} ^docs\.angularjs\.org$ |
| 35 | +RewriteCond %{REQUEST_URI} !^/\d+\.\d+\.\d+ |
| 36 | +RewriteCond %{REQUEST_URI} !^/latest |
| 37 | +RewriteCond %{REQUEST_URI} !^/angular- |
| 38 | +RewriteCond %{REQUEST_URI} !^/favicon.ico |
| 39 | +RewriteRule ^(.*)$ /latest/docs/$1 |
| 40 | + |
| 41 | +## NEXT ## |
| 42 | + |
| 43 | +# RewriteRule ^0\.10\.\d+/docs-0\.10\.\d+/appcache\.manifest$ /next/docs/appcache.manifest [L] |
| 44 | +# RewriteRule ^0.10.[0-9]+/docs-0.10.[0-9]+/appcache.manifest$ /next/docs/appcache.manifest [L] |
| 45 | +# RewriteRule ^(foo)$ /X/$1 [R] |
| 46 | + |
| 47 | +# If the user has forgot the trailing slash than add it through redirect |
| 48 | +RewriteRule ^next$ /next/ [R] |
| 49 | +RewriteRule ^next/docs$ /next/docs/ [R] |
| 50 | + |
| 51 | +# To change the latest version just change this line. |
| 52 | +# IMPORTANT: the order of lines matters, do not move to top! |
| 53 | +RewriteRule ^next/(.*)$ /1.0.0rc6/$1 |
| 54 | + |
| 55 | + |
| 56 | +# If the request comes on http://docs-next.angularjs.org and asks for a versioned appcache manifest |
| 57 | +# point it to the lastest manifest next/docs |
| 58 | +# RewriteCond %{HTTP_HOST} ^docs-next\.angularjs\.org$ |
| 59 | +# RewriteCond %{REQUEST_URI} ^0\.10\.\d+/docs-0\.10\.\d+/appcache\.manifest$ |
| 60 | +# RewriteRule ^(.*)$ /next/docs/appcache.manifest |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | +# If the request comes on http://docs-next.angularjs.org then point it to next/docs |
| 65 | +#RewriteCond %{HTTP_HOST} ^docs-next\.angularjs\.org$ |
| 66 | +#RewriteCond %{REQUEST_URI} !^/\d+\.\d+\.\d+ |
| 67 | +#RewriteCond %{REQUEST_URI} !^/next |
| 68 | +#RewriteCond %{REQUEST_URI} !^/angular- |
| 69 | +#RewriteCond %{REQUEST_URI} !^/favicon.ico |
| 70 | +#RewriteRule ^(.*)$ /next/docs/$1 |
| 71 | + |
| 72 | + |
| 73 | +## PERFORMANCE ## |
| 74 | + |
| 75 | +ExpiresActive On |
| 76 | + |
| 77 | +# cache js files for one year |
| 78 | +<FilesMatch "^angular-(ie-compat-)?[\d\.]+(\.min)?\.js"> |
| 79 | +ExpiresDefault "access plus 1 year" |
| 80 | +</FilesMatch> |
| 81 | + |
| 82 | +# don't cache appcache manifests |
| 83 | +<FilesMatch "\.manifest$"> |
| 84 | +ExpiresDefault "access" |
| 85 | +</FilesMatch> |
| 86 | + |
| 87 | +# cache everything else for 1h |
| 88 | +ExpiresDefault "access plus 60 minutes" |
| 89 | + |
| 90 | + |
| 91 | +# compression |
| 92 | +SetOutputFilter DEFLATE |
| 93 | +Header set Vary "Accept-Encoding" |
| 94 | + |
| 95 | + |
| 96 | +# content types |
| 97 | +AddType application/javascript js |
| 98 | +AddType text/cache-manifest .manifest |
| 99 | + |
0 commit comments