blob: 05b183968ee02790cab71095c18c857e3b5a2051 [file] [log] [blame]
##################################################
# Redirects carried from Apache CMS based site #
##################################################
# Individual deleted/renamed pages
Redirect permanent /commercial-support.html /about/support/index.html
Redirect permanent /documentation.html /docs/index.html
Redirect permanent /doc12/documentation.html /docs/1.2/index.html
Redirect permanent /doc20/documentation.html /docs/2.0/index.html
Redirect permanent /doc/documentation.html /docs/3.0/index.html
Redirect permanent /privacy-policy.html https://privacy.apache.org/policies/privacy-policy-public.html
# Remaping legacy doc folders
Redirect permanent /doc12/ /docs/1.2/
Redirect permanent /doc20/ /docs/2.0/
Redirect permanent /doc/ /docs/3.0/
# Remapping dev folders
Redirect permanent /developer-guide.html /dev/index.html
Redirect permanent /how_development_happens.html /dev/how_development_happens.html
Redirect permanent /code-repository.html /dev/code-repository.html
Redirect permanent /eclipse.html /dev/
Redirect permanent /dev/eclipse.html /dev/
Redirect permanent /building-cayenne.html /dev/building-cayenne.html
Redirect permanent /release-guide.html /dev/release-guide.html
Redirect permanent /running-unit-tests.html /dev/running-unit-tests.html
##################################################
# Remaping Apache CMS -> Hugo based site #
##################################################
Redirect permanent /support.html /about/support/
Redirect permanent /download.html /download/
# Links without direct replacement in new site
Redirect permanent /docs/legacy.html /docs/3.0/
Redirect permanent /about.html /
Redirect permanent /collaboration.html /
Redirect permanent /legacy-ant-documentation-export.html /
##################################################
# Remaping docbook based docs to asciidocs based #
##################################################
# Redirect main sections of Cayenne Guide
RedirectMatch permanent ^/docs/([1-3]\.[0-9]+)/cayenne-guide/cayenne-guide-part1.html$ /docs/$1/cayenne-guide/#object-relational-mapping-with-cayenne
RedirectMatch permanent ^/docs/([1-3]\.[0-9]+)/cayenne-guide/cayenne-guide-part2.html$ /docs/$1/cayenne-guide/#cayenne-framework
RedirectMatch permanent ^/docs/([1-3]\.[0-9]+)/cayenne-guide/cayenne-guide-part3.html$ /docs/$1/cayenne-guide/#cayenne-framework-remote-object-persistence
RedirectMatch permanent ^/docs/([1-3]\.[0-9]+)/cayenne-guide/cayenne-guide-part4.html$ /docs/$1/cayenne-guide/#db-first-flow
RedirectMatch permanent ^/docs/([1-3]\.[0-9]+)/cayenne-guide/cayenne-guide-part5.html$ /docs/$1/cayenne-guide/#cayenne-additional-modules
# Tutorial
RedirectMatch permanent ^/docs/([0-9\.]+)/tutorial/getting-started-part1.html$ /docs/$1/getting-started-guide/#setting-up-the-environment
RedirectMatch permanent ^/docs/([0-9\.]+)/tutorial/getting-started-part2.html$ /docs/$1/getting-started-guide/#learning-mapping-basics
RedirectMatch permanent ^/docs/([0-9\.]+)/tutorial/getting-started-part3.html$ /docs/$1/getting-started-guide/#learning-cayenne-api
RedirectMatch permanent ^/docs/([0-9\.]+)/tutorial/getting-started-part4.html$ /docs/$1/getting-started-guide/#converting-to-web-application
# Rop tutorial
RedirectMatch permanent ^/docs/([0-9\.]+)/tutorial-rop/ch01.html$ /docs/$1/getting-started-rop/#prerequisites-2
RedirectMatch permanent ^/docs/([0-9\.]+)/tutorial-rop/ch02.html$ /docs/$1/getting-started-rop/#starting-client-project
RedirectMatch permanent ^/docs/([0-9\.]+)/tutorial-rop/ch03.html$ /docs/$1/getting-started-rop/#setting-up-hessian-web-service
RedirectMatch permanent ^/docs/([0-9\.]+)/tutorial-rop/ch04.html$ /docs/$1/getting-started-rop/#porting-existing-code-to-connect-to-a-web-service-instead-of-a-database
RedirectMatch permanent ^/docs/([0-9\.]+)/tutorial-rop/ch05.html$ /docs/$1/getting-started-rop/#adding-basic-authentication
RedirectMatch permanent ^/docs/([0-9\.]+)/tutorial-rop/getting-started-rop-part1.html$ /docs/$1/getting-started-rop/#prerequisites
RedirectMatch permanent ^/docs/([0-9\.]+)/tutorial-rop/getting-started-rop-part2.html$ /docs/$1/getting-started-rop/#remote-object-persistence-quick-start
# Redirect all except index.html to exclude cyclic redirection
RedirectMatch permanent ^/docs/([1-3]\.[0-9]+)/cayenne-guide/(?!index)(.*)\.html$ /docs/$1/cayenne-guide/#$2
RedirectMatch permanent ^/docs/([1-3]\.[0-9]+)/upgrade-guide/(?!index)(.*)\.html$ /docs/$1/upgrade-guide/#$2
# Redirect everything else
RedirectMatch permanent ^/docs/([0-9\.]+)/tutorial/(.*)\.html$ /docs/$1/getting-started-guide/\#$2
RedirectMatch permanent ^/docs/([0-9\.]+)/tutorial-rop/(.*)\.html$ /docs/$1/getting-started-rop/\#$2
##################################################
# Additional parameters and optimizations #
##################################################
# Custom 404 error page
ErrorDocument 404 /404.html
# Hide .git related content
RedirectMatch 404 /\.git
# Cache for one month static assets
<filesMatch ".(css|jpg|jpeg|png|gif|svg|js|ico|zip)$">
Header set Cache-Control "max-age=2628000, public"
</filesMatch>
Header set Content-Security-Policy "img-src https://*; frame-src youtube.com https://www.youtube.com;"
# Enable gzip compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/opentype
# For Older Browsers Which Can't Handle Compression
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(schema)($|/) - [L]
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>