From eb763d2dc2da197c2a42a9440e86dd632b7d177a Mon Sep 17 00:00:00 2001 From: raincoats Date: Sun, 5 Mar 2017 16:58:21 +1100 Subject: [PATCH] Redirect to admin panel when accessing 'http://pi.hole/' If someone tries to access 'http://pi.hole/', it will take them to the "Website blocked" page. Very confusing if you don't know to go to 'http://pi.hole/admin/'. This just redirects them to the admin panel. --- advanced/index.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/advanced/index.php b/advanced/index.php index c076f92d..05b0811f 100644 --- a/advanced/index.php +++ b/advanced/index.php @@ -4,6 +4,14 @@ $uri = escapeshellcmd($_SERVER['REQUEST_URI']); $serverName = escapeshellcmd($_SERVER['SERVER_NAME']); +// If the server name is 'pi.hole', it's likely a user trying to get to the admin panel. +// Let's be nice and redirect them. +if ($serverName === 'pi.hole') +{ + header('HTTP/1.1 302 Found'); + header("Location: /admin/"); +} + // Retrieve server URI extension (EG: jpg, exe, php) $uriExt = pathinfo($uri, PATHINFO_EXTENSION);