Repository: cayenne-website Updated Branches: refs/heads/master 3d86ab416 -> 852e189fa
Add more redirects to match old site structure Project: http://git-wip-us.apache.org/repos/asf/cayenne-website/repo Commit: http://git-wip-us.apache.org/repos/asf/cayenne-website/commit/852e189f Tree: http://git-wip-us.apache.org/repos/asf/cayenne-website/tree/852e189f Diff: http://git-wip-us.apache.org/repos/asf/cayenne-website/diff/852e189f Branch: refs/heads/master Commit: 852e189fab2bb1da11aab2e63529061f23642b3d Parents: 3d86ab4 Author: Nikita Timofeev <stari...@gmail.com> Authored: Thu Jan 18 12:38:18 2018 +0300 Committer: Nikita Timofeev <stari...@gmail.com> Committed: Thu Jan 18 12:38:18 2018 +0300 ---------------------------------------------------------------------- src/main/site/static/.htaccess | 60 +++++++++++++++++++++++++++++-------- 1 file changed, 48 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cayenne-website/blob/852e189f/src/main/site/static/.htaccess ---------------------------------------------------------------------- diff --git a/src/main/site/static/.htaccess b/src/main/site/static/.htaccess index 85a365c..2cb97ba 100644 --- a/src/main/site/static/.htaccess +++ b/src/main/site/static/.htaccess @@ -1,3 +1,6 @@ +################################################## +# Redirects carried from Apache CMS based site # +################################################## # Individual deleted/renamed pages Redirect permanent /commercial-support.html /about/support/index.html @@ -20,35 +23,68 @@ 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 old -> new cayenne site +################################################## +# Remaping Apache CMS -> Hugo based site # +################################################## + Redirect permanent /support.html /about/support/ Redirect permanent /download.html /download/ -# Remaping docbook based docs to asciidocs based -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 -# Redirect all except index.html to exclude cyclic redirection -RedirectMatch permanent ^/docs/([0-9\.]+)/cayenne-guide/(?!index)(.*)\.html$ /docs/$1/cayenne-guide/#$2 -RedirectMatch permanent ^/docs/([0-9\.]+)/upgrade-guide/(?!index)(.*)\.html$ /docs/$1/upgrade-guide/#$2 - # 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 /thanks.html / -Redirect permanent /release-guide-2.0.html /dev/release-guide.html Redirect permanent /legacy-ant-documentation-export.html / +################################################## +# Remaping docbook based docs to asciidocs based # +################################################## + +# Redirect main sections of Cayenne Guide +RedirectMatch permanent ^/docs/([0-9\.]+)/cayenne-guide/cayenne-guide-part1.html$ /docs/$1/cayenne-guide/#object-relational-mapping-with-cayenne +RedirectMatch permanent ^/docs/([0-9\.]+)/cayenne-guide/cayenne-guide-part2.html$ /docs/$1/cayenne-guide/#cayenne-framework +RedirectMatch permanent ^/docs/([0-9\.]+)/cayenne-guide/cayenne-guide-part3.html$ /docs/$1/cayenne-guide/#cayenne-framework-remote-object-persistence +RedirectMatch permanent ^/docs/([0-9\.]+)/cayenne-guide/cayenne-guide-part4.html$ /docs/$1/cayenne-guide/#db-first-flow +RedirectMatch permanent ^/docs/([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/([0-9\.]+)/cayenne-guide/(?!index)(.*)\.html$ /docs/$1/cayenne-guide/#$2 +RedirectMatch permanent ^/docs/([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 -# Disable .git related content + +# Hide .git related content RedirectMatch 404 /\.git -# One month for most static assets +# Cache for one month static assets <filesMatch ".(css|jpg|jpeg|png|gif|svg|js|ico)$"> Header set Cache-Control "max-age=2628000, public" </filesMatch> +# Enable gzip compression <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/css