From 2e1ebff965b45e64f558af59c8f013cf82f46edb Mon Sep 17 00:00:00 2001
From: Michael Fairchild <mfairchild365@gmail.com>
Date: Fri, 16 Aug 2013 09:47:54 -0500
Subject: [PATCH] Redirect to the internal home page if on campus

Move redirect rules into .htaccess and redirect to news.unl.edu for internal page
---
 .htaccess   | 11 +++++++++++
 index.shtml | 24 +++++-------------------
 2 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/.htaccess b/.htaccess
index 37818bec..fd96d537 100644
--- a/.htaccess
+++ b/.htaccess
@@ -3,6 +3,17 @@ RewriteEngine On
 RewriteRule ^news/$    http://newsroom.unl.edu/         [R=301]
 RewriteRule ^international/$    http://international.unl.edu/         [R=301]
 RewriteRule ^foodfuelwaterphotocontest/$    http://innovate.unl.edu/photocontest/        [R=301]
+
+RewriteCond %{REMOTE_HOST} ^129\.93 [OR]
+RewriteCond %{REMOTE_HOST} ^10\.20\. [OR]
+RewriteCond %{REMOTE_HOST} ^10\.21\. [OR]
+RewriteCond %{REMOTE_HOST} ^65\.123\.(3[2-9]|[4-5][0-9]|6[0-3])\. [OR]
+RewriteCond %{REMOTE_HOST} ^64\.39\.(24[0-9]|25[0-5])\. [OR]
+RewriteCond %{REMOTE_HOST} ^216\.218\.(20[8-9]|21[0-9]|22[0-3])\.
+RewriteCond %{REQUEST_URI} /ucomm/$ [OR]
+RewriteCond %{REQUEST_URI} /ucomm/index.shtml$ 
+RewriteRule (.*) http://news.unl.edu/newsrooms/unltoday/ [R=302,L]
+
 #RewriteRule ^depts/.*$  http://directory.unl.edu/departments/academic [R=301]
 
 ## If mobile=no, don't redirect the user specifically request no mobileversion
diff --git a/index.shtml b/index.shtml
index ef5492da..c3a46e11 100644
--- a/index.shtml
+++ b/index.shtml
@@ -1,21 +1,7 @@
 <!--#set var="low_bandwidth" value="true" --><!--#if expr='$low_bandwidth = false' --><!--#include virtual="/ucomm/low_bandwidth/index.shtml" --><!--#else -->
-<!--#if expr="
-        ($REMOTE_ADDR = /^129\.93/) ||
-        ($REMOTE_ADDR = /^10\.20\./) ||
-        ($REMOTE_ADDR = /^10\.21\./) ||
-        ($REMOTE_ADDR = /^65\.123\.(3[2-9]|[4-5][0-9]|6[0-3])\./) ||
-        ($REMOTE_ADDR = /^64\.39\.(24[0-9]|25[0-5])\./) ||
-        ($REMOTE_ADDR = /^216\.218\.(20[8-9]|21[0-9]|22[0-3])\./)
-" -->
-    <!--#if expr='$QUERY_STRING = /^mobile=no/' -->
-        <!--#include virtual="/ucomm/unltoday/index.shtml?mobile=no" -->
-    <!--#else -->
-        <!--#include virtual="/ucomm/unltoday/index.shtml" -->
-    <!--#endif -->
+<!--#if expr='$QUERY_STRING = /^mobile=no/' -->
+    <!--#include virtual="/ucomm/splash/index.shtml?mobile=no" -->
 <!--#else -->
-    <!--#if expr='$QUERY_STRING = /^mobile=no/' -->
-        <!--#include virtual="/ucomm/splash/index.shtml?mobile=no" -->
-    <!--#else -->
-        <!--#include virtual="/ucomm/splash/index.shtml" -->
-    <!--#endif -->
-<!--#endif --><!--#endif -->
+    <!--#include virtual="/ucomm/splash/index.shtml" -->
+<!--#endif -->
+<!--#endif -->
\ No newline at end of file
-- 
GitLab