summaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/index.php b/index.php
index 8e06975..3b8250a 100644
--- a/index.php
+++ b/index.php
@@ -2,12 +2,18 @@
$dest = @readlink($_SERVER['SCRIPT_FILENAME']);
if (!empty($dest) && $dest !== $_SERVER['SCRIPT_FILENAME']) {
- //error_log($dest . ' !== ' . $_SERVER['SCRIPT_FILENAME'] . ', chdir to ' . dirname($dest));
chdir(dirname($dest));
}
require_once 'config.php';
+if (defined('CONFIG_FORCE_DOMAIN')) {
+ if (!empty($_SERVER['SERVER_NAME']) && strcasecmp($_SERVER['SERVER_NAME'], CONFIG_FORCE_DOMAIN) !== 0) {
+ Header('HTTP/1.1 400 Bad Request');
+ die('<h1>Bad Request</h1>');
+ }
+}
+
/**
* Page class which all "modules" must be extending from