From fc82ee2c5b07227e1253c9176af4735594342426 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Fri, 20 Nov 2020 11:48:00 +1100 Subject: [PATCH] codesearch: redirect other hostnames to codesearch.opendev.org Make sure things like https://codesearch01.opendev.org or https://codesearch.openstack.org all get redirected to the main http://codesearch.opendev.org site. Change-Id: Ifb2c810425b60474ba3581611d85ddcc5c77f130 --- playbooks/roles/codesearch/templates/codesearch.vhost.j2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/playbooks/roles/codesearch/templates/codesearch.vhost.j2 b/playbooks/roles/codesearch/templates/codesearch.vhost.j2 index 17549fa59a..de70b25c7d 100644 --- a/playbooks/roles/codesearch/templates/codesearch.vhost.j2 +++ b/playbooks/roles/codesearch/templates/codesearch.vhost.j2 @@ -16,6 +16,9 @@ ServerName {{ inventory_hostname }} ServerAdmin webmaster@openstack.org + RewriteCond %{HTTP_HOST} !^codesearch\.opendev\.org [nocase] + RewriteRule ^/(.*) https://codesearch.opendev.org/$1 [last,redirect=permanent] + AllowEncodedSlashes On ErrorLog ${APACHE_LOG_DIR}/codesearch-ssl-error.log