Doug Hellmann 079714fe21 add has_in_tree_htaccess flag to template generator
Add a flag to tell us which projects have a .htaccess file in their
doc build output.

Change-Id: I0af0e32d9c646d61f4c72599cdc4613299aa5ec9
Depends-On: I236b7b0a9aae065167bd0aef316603d258e4c3c6
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-07-31 17:21:37 -04:00

97 lines
4.2 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 O'Reilly Operations Guide PDF to trunk version
redirect 301 /trunk/openstack-ops/oreilly-openstack-ops-guide.pdf /openstack-ops/openstack-ops-manual.pdf
# Redirect old Admin Guide to new landing page
redirectmatch 301 ^/admin-guide/.*$ /{{RELEASED_SERIES}}/admin/index.html
# 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 removed user guide
redirectmatch 301 ^/user-guide/.*$ /{{RELEASED_SERIES}}/user/
# Redirect removed ops guide
redirectmatch 301 ^/ops-guide/.*$ /{{RELEASED_SERIES}}/admin/
# 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
# 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