From 9cb455f1cc16abb0ceec8813987db4715f63a63a Mon Sep 17 00:00:00 2001 From: rajat29 Date: Thu, 3 Aug 2017 15:39:17 +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: I256d69f08499549e9e21179eb89f49cda79f7ac7 --- doc/source/_extra/.htaccess | 3 +++ doc/source/conf.py | 4 ++++ 2 files changed, 7 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 00000000..af736ab1 --- /dev/null +++ b/doc/source/_extra/.htaccess @@ -0,0 +1,3 @@ +redirectmatch 301 ^/castellan/([^/]+)/usage.html$ ^/user/index.html +redirectmatch 301 ^/castellan/([^/]+)/testing.html$ ^/contributor/testing.html +redirectmatch 301 ^/castellan/([^/]+)/installation.html$ ^/install/index.html diff --git a/doc/source/conf.py b/doc/source/conf.py index 6e2377f7..98678958 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -64,6 +64,10 @@ htmlhelp_basename = '%sdoc' % project # html_last_updated_fmt = '%b %d, %Y' html_last_updated_fmt = '%Y-%m-%d %H:%M' +# Add any paths that contain "extra" files, such as .htaccess or +# robots.txt. +html_extra_path = ['_extra'] + # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass # [howto/manual]).