chore(docs/.htaccess): bundle .htaccess with docs

This commit is contained in:
Igor Minar 2011-07-19 16:58:40 -07:00
parent 3ea2416f80
commit ad3b8d7bcf
2 changed files with 58 additions and 0 deletions

View file

@ -27,6 +27,7 @@ var writes = callback.chain(function(){
writer.copyDir('img', writes.waitFor());
writer.copyDir('examples', writes.waitFor());
writer.copyTpl('index.html', writes.waitFor());
writer.copyTpl('.htaccess', writes.waitFor());
writer.copy('docs/src/templates/index.html', 'build/docs/index-jq.html', writes.waitFor(),
'<-- jquery place holder -->', '<script src=\"jquery.min.js\"><\/script>');
writer.copyTpl('offline.html', writes.waitFor());

View file

@ -0,0 +1,57 @@
Options +Indexes
IndexIgnore favicon.ico
RewriteEngine on
# Enable Crawling of AJAX apps.
# See: http://code.google.com/web/ajaxcrawling/docs/getting-started.html
RewriteCond %{QUERY_STRING} ^_escaped_fragment_=\/(.*)$
RewriteRule ^(.*)$ /$1/%1.html?
# Map versiond angular files to root folder.
RewriteRule ^angular([\-\w]+)(\d+\.\d+\.\d+)(.*)$ /$2/angular$1$2$3
# 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
RewriteRule ^(\d+\.\d+\.\d+)/docs/(.*)$ /$1/docs-$1/$2
# 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/(.*)$ /0.9.17/$1
# If the request comes on http://docs.angularjs.org then point it to latest/docs
RewriteCond %{HTTP_HOST} ^docs\.angularjs\.org$
RewriteCond %{REQUEST_URI} !^/\d+\.\d+\.\d+
RewriteCond %{REQUEST_URI} !^/latest
RewriteCond %{REQUEST_URI} !^/angular-
RewriteCond %{REQUEST_URI} !^/favicon.ico
RewriteRule ^(.*)$ /latest/docs/$1
## PERFORMANCE ##
ExpiresActive On
# cache js files for one year
<FilesMatch "^angular-(ie-compat-)?[\d\.]+(\.min)?\.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