From 4aed59d263f47458bd9e8d49f84b69f1fb611adf Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Fri, 4 Jun 2021 17:51:09 +0000 Subject: [PATCH] Always redirect project contributor docs to latest It doesn't really make sense to publish multiple versions of contributor documentation, but when contributor documentation is included in branched projects this is precisely what we end up with. Luckily, the recent work to standardize project contributor docs puts them under a consistent subtree of the each project's documentation, so we can easily match on them. In order to avoid things like web search results and stale bookmarks sending unwary users to outdated versions of contributor information, just always redirect any old series to "latest" instead. Change-Id: If55ec3d4e0c98e43e985e293f23813794315450d --- www/.htaccess | 3 +++ www/redirect-tests.txt | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/www/.htaccess b/www/.htaccess index 1f58e0c293..4d24e17113 100644 --- a/www/.htaccess +++ b/www/.htaccess @@ -185,6 +185,9 @@ redirect 301 /doc-contrib-guide/ui-text-guidelines /doc-contrib-guide/ux-ui-guid {%- endif %} {%- endfor %} +# Redirect project contributor docs for stable series to latest +redirectmatch 301 /([^/]+)/(?!latest)[^/]+/contributor(/.*)?$ /$1/latest/contributor$2 + # Redirect old cli-reference to the OSC latest docs {{ path_to_page('/cli-reference', '/python-openstackclient/latest/') }} diff --git a/www/redirect-tests.txt b/www/redirect-tests.txt index 8f9843079f..868fc5bf96 100644 --- a/www/redirect-tests.txt +++ b/www/redirect-tests.txt @@ -212,6 +212,11 @@ {% endif -%} {%- endfor %} +# Redirect project contributor docs for stable series to latest +/nova/wallaby/contributor 301 /nova/latest/contributor +/swift/xena/contributor/ 301 /swift/latest/contributor/ +/cinder/pike/contributor/foo.html 301 /cinder/latest/contributor/foo.html + # Redirect old cli-reference to the OSC latest docs {{ path_to_page('/cli-reference', '/python-openstackclient/latest/') }}