openstack-manuals/www/.htaccess
Andreas Jaeger 80e8d52f4d [www] Add kolla and kuryr projects
Redirect kolla and kuryr subprojects to the new location.

Add kuryr to index page, kolla is already there.

Change-Id: Iaa79de91ea0169ae971ad5d64fc63f63d24364d4
2017-08-22 19:01:26 +02:00

133 lines
5.9 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-(ansible|kubernetes)/(.*)$ /kolla-$1/latest/$2
# Redirect all openstack-ansible repositories appropriately
redirectmatch 301 ^/developer/(ansible-hardening|openstack-ansible-[^/]+)/(.*)$ /$1/latest/$2
# 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 /contributor-guide/common/glossary.html
redirect 301 /icehouse/training-guides/ /upstream-training/
# Redirect changed directory name in the Contributor Guide
redirect 301 /contributor-guide/ui-text-guidelines.html /contributor-guide/ux-ui-guidelines/ui-text-guidelines.html
redirect 301 /contributor-guide/ui-text-guidelines /contributor-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/openstack-ansible/$" /project-deploy-guide/openstack-ansible/{{RELEASED_SERIES}}/
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 developer location
redirectmatch 301 "^/infra/shade(.*)$" /developer/shade$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') -%}
{%- 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) %}
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