From 2b56671e43a6347bfad180955c5bb14aa5c03d0d Mon Sep 17 00:00:00 2001
From: Peter Palfrader <peter@palfrader.org>
Date: Tue, 22 Jul 2014 21:25:58 +0200
Subject: [PATCH] bits.d.o: redirect everything but /feeds to https

---
 .../static-mirroring/vhost/static-vhosts-simple.erb        | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/modules/roles/templates/static-mirroring/vhost/static-vhosts-simple.erb b/modules/roles/templates/static-mirroring/vhost/static-vhosts-simple.erb
index 79531d28..2e0ed8c1 100644
--- a/modules/roles/templates/static-mirroring/vhost/static-vhosts-simple.erb
+++ b/modules/roles/templates/static-mirroring/vhost/static-vhosts-simple.erb
@@ -28,6 +28,13 @@ Use common-static-vhost-with-extra security-team.debian.org "ServerAlias securit
 </Macro>
 
 <Virtualhost <%= vhost_listen %> >
+	RewriteEngine on
+
+	RewriteEngine On
+	RewriteCond %{REQUEST_URI} !^/feeds/
+	RewriteRule ^/(.*)$ https://bits.debian.org/$1 [R,L]
+	#RewriteRule ^/(.*)$ https://bits.debian.org/$1 [NC,R=301,L]
+
 	Use static-bits.debian.org-base
 	CustomLog /var/log/apache2/bits.debian.org-access.log privacy
 </VirtualHost>
-- 
2.39.5