From 5abf2667c0bbd948d12679226e44d729363d522d Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 30 May 2016 10:29:37 +1200 Subject: [PATCH] Auto-redirect /contributing to current master docs (fixes #121) --- .htaccess | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.htaccess b/.htaccess index 3a804d5..89a4124 100644 --- a/.htaccess +++ b/.htaccess @@ -41,6 +41,10 @@ ErrorDocument 500 /assets/error-500.html RewriteCond %{REQUEST_URI} ^/?framework/en/ RewriteRule ^framework/en/(.*)$ /en/$1 [R=301,NC,QSA,L] + # Docs in /contributing are version agnostic, and should always point to latest + RewriteCond %{REQUEST_URI} !(4.0) + RewriteRule ^(.*)/(.*)/contributing/?(.*)?$ /$1/4.0/contributing/$3 [R=301,L] + # DokuWiki rewrite rules: Need to happen before other rules in order to redirect /doku.php?id= # to /pagename, which can then be matched by the legacy rewrite rules further down RewriteCond %{QUERY_STRING} ^(\bid\b=([^&]*)&?(.*)?)