From bca2c227a0bfdba94741e43e6b2d880c66aef7f3 Mon Sep 17 00:00:00 2001
From: Thomas Wood <thomas.wood09@imperial.ac.uk>
Date: Mon, 18 Jul 2016 04:21:27 +0100
Subject: [PATCH] Fix .htaccess rules for /ci/

---
 ci/.htaccess | 32 +++++++++++---------------------
 1 file changed, 11 insertions(+), 21 deletions(-)

diff --git a/ci/.htaccess b/ci/.htaccess
index d7b08b2..dd691a0 100644
--- a/ci/.htaccess
+++ b/ci/.htaccess
@@ -1,23 +1,13 @@
-BrowserMatch ^GitHub-Hookshot github_bot
-
-Order deny,allow
-Deny from all
-Allow from 146.169
-Allow from 146.179
-Allow from 155.198
-Allow from 131.254
-Allow from env=github_bot
-
 RewriteEngine On
-RewriteBase /ci/
-
-# Append missing directory slashes for top-level paths
-RewriteRule ^([^/]+)$ $1/ [R,L]
-
-# Force to HTTPS
-RewriteCond %{HTTPS} =off [OR]
-RewriteCond %{HTTP_HOST} !=psvg.doc.ic.ac.uk
-RewriteRule ^(.*)$ https://psvg.doc.ic.ac.uk/ci/$1 [R=301,L]
 
-# Proxy through to the internal server
-RewriteRule ^(.*)$ https://146.169.46.217/ci/$1 [P]
+<If "%{HTTPS} == 'off' || %{HTTP_HOST} != 'psvg.doc.ic.ac.uk'">
+  RewriteRule ^/vol/rr/www/(.*) https://psvg.doc.ic.ac.uk/$1 [R=301,L]
+</If>
+<Else>
+  AuthType KerberosV5
+  AuthName "PSVG Group Members Only -- Imperial College Login"
+  Require group rr
+
+  # Proxy through to the internal server
+  RewriteRule ^/vol/rr/www/(.*) https://146.169.46.217/$1 [P]
+</Else>
-- 
GitLab