mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Merge pull request #1297 from raincoats/development
Redirect to admin panel when accessing 'http://pi.hole/'
This commit is contained in:
commit
bfc4775b34
1 changed files with 8 additions and 0 deletions
|
@ -12,6 +12,14 @@ function validIP($address){
|
|||
$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 301 Moved Permanently');
|
||||
header("Location: /admin/");
|
||||
}
|
||||
|
||||
// Retrieve server URI extension (EG: jpg, exe, php)
|
||||
ini_set('pcre.recursion_limit',100);
|
||||
$uriExt = pathinfo($uri, PATHINFO_EXTENSION);
|
||||
|
|
Loading…
Reference in a new issue