From cd2fef95ca1462f9c8d026dd19c20a84deba3157 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Mon, 6 Nov 2017 20:11:45 -0500 Subject: [PATCH] Add a .htaccess for redirecting old paths This commit adds an .htaccess file to the tempest docs to handle redirecting old paths to the new location. Before the docs migration in the past we had docs located at docs.openstack.org/developer/tempest and now things are located in docs.openstack.org/tempest/latest. With this file we should be properly redirecting old links to the new location. Change-Id: Idec7b2f299ade9b7dcc678ea1daf8daa25f08c44 --- doc/source/_extra/.htaccess | 1 + doc/source/conf.py | 3 +++ 2 files changed, 4 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 0000000000..7745594937 --- /dev/null +++ b/doc/source/_extra/.htaccess @@ -0,0 +1 @@ +redirectmatch 301 ^/developer/tempest/(.*) /tempest/latest/$1 diff --git a/doc/source/conf.py b/doc/source/conf.py index 067eb81b78..0a061b8a54 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -154,6 +154,9 @@ html_theme = 'openstackdocs' # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] +# Add any paths that contain "extra" files, such as .htaccess or +# robots.txt. +html_extra_path = ['_extra'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format.