openstack-manuals/www/.htaccess
Doug Hellmann e6bf33566a parameterize the deploy guide list
Update the page template for the deployment guide list to use the
project-data.

Add data to pike for the existing deployment guides.

Update the latest project-data file for the available deployment
guides for queens.

Change-Id: Idc5923ee8b930c75594d42d91450b25be7ee4594
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-09-26 17:26:21 -04:00

147 lines
6.6 KiB
ApacheConf

{# NOTE(dhellmann): This file is not in a series directory,
so we need to set the series name ourselves. #}
{% set series = 'latest' %}
{% set projects = PROJECT_DATA[series] %}
# Redirect old top-level HTML pages to the version under most recent
# full release.
redirectmatch 301 ^/$ /{{RELEASED_SERIES}}/
redirectmatch 301 ^/index.html$ /{{RELEASED_SERIES}}/
redirectmatch 301 ^/openstack-projects.html$ /{{RELEASED_SERIES}}/projects.html
redirectmatch 301 ^/language-bindings.html$ /{{RELEASED_SERIES}}/language-bindings.html
# Redirect docs.openstack.org index.html subpage pointers to main page
redirect 301 /install/ /{{RELEASED_SERIES}}/install/
redirect 301 /basic-install/ /{{RELEASED_SERIES}}/install/
redirect 301 /run/ /
redirect 301 /developer/index.html /{{RELEASED_SERIES}}/projects.html
redirect 301 /cli/ /
redirect 301 /api/api-specs.html http://developer.openstack.org/api-guide/quick-start/index.html
# Redirect old Admin Guides to new landing page
redirectmatch 301 ^/admin-guide/.*$ /{{RELEASED_SERIES}}/admin/
redirectmatch 301 ^/user-guide-admin/.*$ /{{RELEASED_SERIES}}/admin/
# A doc generation bug resulted in Google indexing links containing "//", which cause
# problems with linked content (images/css/etc). This rule generates a 301 redirect
# for these links.
#
# details: https://bugs.launchpad.net/openstack-manuals/+bug/1288513
redirectmatch 301 (.*)//(.*) $1/$2
# Redirect networking-guide since it is now versioned
redirect 301 /networking-guide/ /ocata/networking-guide/
# Redirect old releases content to new location
redirectmatch 301 "^/releases(.*)$" http://releases.openstack.org$1
# redirect all kuryr sub-repositories appropriately
redirectmatch 301 ^/developer/kuryr-(kubernetes|libnetwork|tempest-plugin)/(.*)$ /kuryr-$1/latest/$2
# redirect all kolla sub-repositories appropriately
redirectmatch 301 ^/developer/kolla-kubernetes/(.*)$ /kolla-kubernetes/latest/$1
# Redirect all openstack-ansible repositories appropriately
redirectmatch 301 ^/developer/(ansible-hardening|openstack-ansible-[^/]+)/(.*)$ /$1/latest/$2
# Redirect some tripleo repositories appropriately
redirectmatch 301 ^/developer/(tripleo-common|tripleo-quickstart|tripleo-validations)/(.*)$ /$1/latest/$2
# Redirect sahara repositories appropriately
redirectmatch 301 ^/developer/sahara-tests/(.*)$ /sahara-tests/latest/$1
# Redirect removed user guide
redirectmatch 301 ^/user-guide/.*$ /{{RELEASED_SERIES}}/user/
# Redirect removed ops guide
redirectmatch 301 ^/ops-guide/.*$ /{{RELEASED_SERIES}}/admin/
redirectmatch 301 ^/ops/.*$ /{{RELEASED_SERIES}}/admin/
redirectmatch 301 ^/openstack-ops/.*$ /{{RELEASED_SERIES}}/admin/
redirectmatch 301 ^/trunk/openstack-ops/.*$ /{{RELEASED_SERIES}}/admin/
# Redirect api list
redirectmatch 301 ^/api/.*$ /{{RELEASED_SERIES}}/api/
# Redirect old security index
redirectmatch 301 ^/sec/.*$ /security-guide/
redirectmatch 301 ^/security-guide/content/.*$ /security-guide/
# Redirect to series indexes
redirectmatch 301 ^/user/.*$ /{{RELEASED_SERIES}}/user/
redirectmatch 301 ^/latest/user/.*$ /{{SERIES_IN_DEVELOPMENT}}/user/
redirectmatch 301 ^/admin/.*$ /{{RELEASED_SERIES}}/admin/
redirectmatch 301 ^/latest/admin/.*$ /{{SERIES_IN_DEVELOPMENT}}/admin/
redirect 301 /latest/ /{{SERIES_IN_DEVELOPMENT}}/
# Redirect some pages users search for
redirectmatch 301 ^/arch-design/content/.*$ /arch-design/
redirectmatch 301 ^/image-guide/content/.*$ /image-guide/
redirectmatch 301 ^/admin-guide-cloud/.*$ /{{RELEASED_SERIES}}/admin/
redirectmatch 301 ^/trunk/openstack-compute/.*$ /nova/latest/admin/
redirect 301 /glossary/content/glossary.html /doc-contrib-guide/common/glossary.html
redirect 301 /icehouse/training-guides/ /upstream-training/
# Redirect contributor-guide URL to doc-contrib-guide
redirectmatch 301 ^/contributor-guide/(.*)$ /doc-contrib-guide/$1
# Redirect changed directory name in the Contributor Guide
redirect 301 /doc-contrib-guide/ui-text-guidelines.html /doc-contrib-guide/ux-ui-guidelines/ui-text-guidelines.html
redirect 301 /doc-contrib-guide/ui-text-guidelines /doc-contrib-guide/ux-ui-guidelines
# Redirect any deploy guide project directory back to the current stable index
redirectmatch 301 "^/project-deploy-guide/$" /{{RELEASED_SERIES}}/deploy/
redirectmatch 301 "^/project-deploy-guide/newton/" /newton/deploy/
redirectmatch 301 "^/project-deploy-guide/ocata/" /ocata/deploy/
# Redirect old install guide list pages to their new home
redirectmatch 301 "^/project-install-guide/newton/" /newton/install/
redirectmatch 301 "^/project-install-guide/ocata/(.*)$" /ocata/install/$1
redirectmatch 301 ^/kilo/install-guide/.*$ /kilo/
redirectmatch 301 ^/juno/install-guide/.*$ /juno/
redirectmatch 301 ^/icehouse/install-guide/.*$ /icehouse/
redirectmatch 301 ^/havana/install-guide/.*$ /havana/
# Redirecting infra docs links to new location
redirectmatch 301 "^/infra/shade(.*)$" /shade/latest$1
# Redirecting old project developer docs to the new layout. If a
# project has an in-tree .htaccess file, assume it can handle the full
# path in the redirect. Otherwise, redirect everything to the new
# latest index.html.
{% for project in projects|sort(attribute='name') -%}
{# use separate rules for project.name$ and project.name/(.*)$ because
some project names are prefixes of other project names (glance and glance_store) #}
redirectmatch 301 "^/developer/{{project.name}}$" /{{project.name}}/latest/
{%- if project.has_in_tree_htaccess %}
redirectmatch 301 "^/developer/{{project.name}}/(.*)$" /{{project.name}}/latest/$1
{%- else %}
redirectmatch 301 "^/developer/{{project.name}}/.*$" /{{project.name}}/latest/
{%- endif %}
{%- endfor %}
# Redirect old cli-reference to the OSC latest docs
redirectmatch 301 "^/cli-reference/.*$" /python-openstackclient/latest/
# Redirects from service-type to code-name
{% for project in projects -%}
{%- if project.type == 'service' and project.service_type and (project.service_type|lower != project.name) %}
{# use separate rules for project.name$ and project.name/(.*)$ because
some project names are prefixes of other project names (glance and glance_store) #}
redirectmatch 302 "^/{{project.service_type|lower}}$" /{{project.name}}/latest/
redirectmatch 302 "^/{{project.service_type|lower}}/.*$" /{{project.name}}/latest/
{%- endif %}
{%- endfor %}
# End service-type redirects
# Redirects from code-name without a series to latest
{% for repo in REGULAR_REPOS %}
redirectmatch 301 "^/{{repo.base}}/?$" /{{repo.base}}/latest/
{%- endfor %}
# End latest code-name redirects
# Redirects from infra code-name without a series to location
{% for repo in INFRA_REPOS %}
redirectmatch 301 "^/{{repo.base}}/?$" /infra/{{repo.base}}/
{%- endfor %}
# End infra code-name redirects