Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
67 lines (40 sloc) 1.72 KB
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
Something went wrong with that request. Please try again.