From 0eb5f38c263a5ea01a7dcdaece01e3e78e462ec3 Mon Sep 17 00:00:00 2001 From: rajat29 Date: Thu, 3 Aug 2017 14:41:32 +0530 Subject: [PATCH] allow redirects in .htaccess files on the static web servers As part of allowing projects to establish redirects when they move documentation pages around, we need to let them use .htaccess files. We only want to allow Redirect and RedirectMatch directives, though. This change restricts the directives on docs.o.o and adds them on the static servers used for drafts published during a build (to allow testing of the redirects). For more details see: http://lists.openstack.org/pipermail/openstack-dev/2017-July/120240.html Change-Id: I754c8016ca2a475e74023017530264e7ae331557 --- doc/source/_extra/.htaccess | 24 ++++++++++++++++++++++++ doc/source/conf.py | 4 ++++ 2 files changed, 28 insertions(+) create mode 100644 doc/source/_extra/.htaccess diff --git a/doc/source/_extra/.htaccess b/doc/source/_extra/.htaccess new file mode 100644 index 000000000..5350fff18 --- /dev/null +++ b/doc/source/_extra/.htaccess @@ -0,0 +1,24 @@ +redirectmatch 301 ^/barbican/([^/]+)/admin-guide-cloud/access_control.html$ ^/barbican/$1/admin/access_control.html +redirectmatch 301 ^/barbican/([^/]+)/admin-guide-cloud/barbican_manage.html$ ^/barbican/$1/admin/barbican_manage.html +redirectmatch 301 ^/barbican/([^/]+)/admin-guide-cloud/database_cleaning.html$ ^/barbican/$1/admin/database_cleaning.html +redirectmatch 301 ^/barbican/([^/]+)/admin-guide-cloud/index.html$ ^/barbican/$1/admin/index.html +redirectmatch 301 ^/barbican/([^/]+)/upgrade/index.html$ ^/admin/upgrade.html +redirectmatch 301 ^/barbican/([^/]+)/setup/audit.html$ ^/configuration/audit.html +redirectmatch 301 ^/barbican/([^/]+)/setup/index.html$ ^/configuration/index.html +redirectmatch 301 ^/barbican/([^/]+)/setup/keystone.html$ ^/configuration/keystone.html +redirectmatch 301 ^/barbican/([^/]+)/setup/noauth.html$ ^/configuration/noauth.html +redirectmatch 301 ^/barbican/([^/]+)/setup/plugin_backends.html$ ^/configuration/plugin_backends.html +redirectmatch 301 ^/barbican/([^/]+)/setup/troubleshooting.html$ ^/configuration/troubleshooting.html +redirectmatch 301 ^/barbican/([^/]+)/contribute/architecture.html$ ^/contributor/architecture.html +redirectmatch 301 ^/barbican/([^/]+)/contribute/database_migration.html$ ^/contributor/database_migration.html +redirectmatch 301 ^/barbican/([^/]+)/contribute/dataflow.html$ ^/contributor/fataflow.html +redirectmatch 301 ^/barbican/([^/]+)/contribute/dependencies.html$ ^/contributor/dependencies.html +redirectmatch 301 ^/barbican/([^/]+)/setup/dev.html$ ^/contributor/dev.html +redirectmatch 301 ^/barbican/([^/]+)/steup/devstack.html$ ^/contributor/devstack.html +redirectmatch 301 ^/barbican/([^/]+)/contribute/getting_involved.html$ ^/contributor/getting_involved.html +redirectmatch 301 ^/barbican/([^/]+)/plugin/crypto.html$ ^/contributor/plugin/crypto.html +redirectmatch 301 ^/barbican/([^/]+)/plugin/index.html$ ^/contributor/plugin/index.html +redirectmatch 301 ^/barbican/([^/]+)/pluhin/secret_store.html$ ^/contributor/plugin/secret_store/html +redirectmatch 301 ^/barbican/([^/]+)/contribute/structure.html$ ^/contributor/structure.html/ +redirectmatch 301 ^/barbican/([^/]+)/testing.html$ ^/contributor/testing.html + diff --git a/doc/source/conf.py b/doc/source/conf.py index 12909a7ec..d9dcec306 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -42,6 +42,10 @@ repository_name = 'openstack/barbican' bug_project = 'barbican' bug_tag = '' +# Add any paths that contain "extra" files, such as .htaccess or +# robots.txt. +html_extra_path = ['_extra'] + # Must set this variable to include year, month, day, hours, and minutes. html_last_updated_fmt = '%Y-%m-%d %H:%M'