From f7b5b56b34ffa7def58c47e27d9a4b3cde8f06df Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Fri, 14 Jul 2017 12:28:45 -0400 Subject: [PATCH] skip redirects when code name matches service type The ec2-api project docs aren't accessible because /ec2-api/ redirects to /ec2-api/latest/ (due to the rule about project URLs without a series) and /ec2-api/.* redirects to /ec2-api/latest/ (due to the rule for service types). The combination ensures that accessing docs.o.o/ec2-api/ results in an infinite redirect loop. This change breaks the loop by skiping the service type rule when the service type and project name match. Change-Id: I79e869b12cbd33f79cd1455d9aa26ec5a6642429 Signed-off-by: Doug Hellmann --- www/.htaccess | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/.htaccess b/www/.htaccess index bc0e829539..caa57dfa89 100644 --- a/www/.htaccess +++ b/www/.htaccess @@ -66,7 +66,7 @@ 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 %} +{%- 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 %}