From 47784c96476e0b264f5e310ac833e0830771f183 Mon Sep 17 00:00:00 2001 From: "The repo.or.cz admin team" Date: Fri, 1 Jan 2021 01:42:50 +0100 Subject: [PATCH] apache.conf.in: redirect git.or.cz traffic The old git.or.cz site redirects its traffic on all incoming port 80 requests. However, it does not have a TLS certificate and by default any traffic to its site on port 443 ends up being served by the default TLS host which will likely be repo.or.cz. Redirect any such traffic for git.or.cz to the same location that the port 80 git.or.cz host would rather than incorrectly handling it. Signed-off-by: The repo.or.cz admin team --- apache.conf.in | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apache.conf.in b/apache.conf.in index 68842f9..035df4c 100644 --- a/apache.conf.in +++ b/apache.conf.in @@ -497,6 +497,18 @@ # while always requiring a certificate for pushing over https RewriteEngine On SSLVerifyClient optional + + # these are left over git.or.cz links that may end up here by default + # as the old git.or.cz site does not have a TLS certificate. + # send them on to the same place that the old git.or.cz site would. + # anything without an exact match on the old site goes to git-scm.com. + RewriteCond %{SERVER_NAME} (^|\.)git.or.cz$ [NC] + RewriteRule ^/man/(.*) https://www.kernel.org/pub/software/scm/git/docs/$1.html [L,NE,R=301] + RewriteCond %{SERVER_NAME} (^|\.)git.or.cz$ [NC] + RewriteRule ^/gitwiki(/.*)? https://git.wiki.kernel.org/index.php$1 [L,NE,R=301] + RewriteCond %{SERVER_NAME} (^|\.)git.or.cz$ [NC] + RewriteRule ^ https://git-scm.com/ [L,NE,R=301] + RewriteCond %{REQUEST_METHOD} ^(GET|HEAD)$ [NC] RewriteCond %{QUERY_STRING} (^|&)service=git-receive-pack(&|$) [NC] RewriteRule /info/refs$ - [NC,NS,env=client_auth_required:1] -- 2.11.4.GIT