diff --git a/deploy-guide/source/_extra/.htaccess b/deploy-guide/source/_extra/.htaccess index 7ac82c4..7505f32 100644 --- a/deploy-guide/source/_extra/.htaccess +++ b/deploy-guide/source/_extra/.htaccess @@ -1 +1,2 @@ -Redirect 301 /config-openstack.html /configure-openstack.html +# Redirects related to gerrit topic 'cdg-reorg' +RedirectMatch 301 ^/project-deploy-guide/charm-deployment-guide/([^/]+)/config-openstack.html /project-deploy-guide/charm-deployment-guide/$1/configure-openstack.html diff --git a/deploy-guide/test/redirect-tests.txt b/deploy-guide/test/redirect-tests.txt new file mode 100644 index 0000000..4134c20 --- /dev/null +++ b/deploy-guide/test/redirect-tests.txt @@ -0,0 +1,16 @@ +# This file contains tests for redirects to handle existing URLs for +# documentation that has been moved. See +# https://docs.openstack.org/whereto/latest/ for details. + +# No redirects +/ 200 +/project-deploy-guide 200 +/project-deploy-guide/charm-deployment-guide 200 +/some/other/project/config-openstack.html 200 +/project-deploy-guide/foo/config-openstack.html 200 + +# Refactoring docs moved config-openstack to configure-openstack +# Make sure new redirects work +/project-deploy-guide/charm-deployment-guide/victoria/config-openstack.html 301 /project-deploy-guide/charm-deployment-guide/victoria/configure-openstack.html +/project-deploy-guide/charm-deployment-guide/latest/config-openstack.html 301 /project-deploy-guide/charm-deployment-guide/latest/configure-openstack.html + diff --git a/requirements.txt b/requirements.txt index 4964b0c..62c3f92 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,3 +6,4 @@ pbr!=2.1.0,>=2.0.0 # Apache-2.0 sphinx>=2.0.0,!=2.1.0 # BSD openstackdocstheme>=2.2.1 # Apache-2.0 +whereto>=0.3.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 0ab5683..b89c5f3 100644 --- a/tox.ini +++ b/tox.ini @@ -13,3 +13,4 @@ commands = {posargs} [testenv:deploy-guide] commands = sphinx-build -a -W -d deploy-guide/build/doctrees -b html deploy-guide/source deploy-guide/build/html + whereto deploy-guide/source/_extra/.htaccess deploy-guide/test/redirect-tests.txt