diff options
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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 |