diff options
| author | Horus3 | 2014-09-18 17:10:39 +0200 |
|---|---|---|
| committer | Horus3 | 2014-09-18 17:10:39 +0200 |
| commit | daea0d8d4fc1610d3cc282b4546d44529271c1b5 (patch) | |
| tree | 96928979d21711b3cc1c94edd53f14db55050adc | |
| parent | 3fc505c312800cb6e4f8eca3cdb9855d340b4000 (diff) | |
| download | vfs-daea0d8d4fc1610d3cc282b4546d44529271c1b5.tar.gz | |
bootstrap file
| -rw-r--r-- | public_html/vfs_bootstrap.php | 37 | ||||
| -rw-r--r-- | public_html/vfs_config.php | 21 |
2 files changed, 44 insertions, 14 deletions
diff --git a/public_html/vfs_bootstrap.php b/public_html/vfs_bootstrap.php index 4f0e05d..13dab22 100644 --- a/public_html/vfs_bootstrap.php +++ b/public_html/vfs_bootstrap.php @@ -3,9 +3,46 @@ require_once( dirname(__FILE__) . '/vfs_config.php'); +# absolute path +if ( ! defined(ABSPATH) ) + define('ABSPATH', dirname(__FILE__) . '/'); + +# file directory +if ( ! defined(FILEPATH) ) + define('FILEPATH', ABSPATH . '../files'); + +# scheme, set to https if set, otherwise plain http +if ( ! defined(SCHEME) ){ + if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') + define('SCHEME', 'https://'); + else + define('SCHEME', 'http://'); +} + +# hostname +if ( ! defined(HOST) ) + define('HOST', $_SERVER['HTTP_HOST']); +if ( ! defined(DOMAIN) ) + define('DOMAIN', SCHEME . HOST); + if ( ! defined(VFS_CLASS) ) define('VFS_CLASS', 'class/'); +# redis access +# if ( ! defined(USE_REDIS) ) +# define('USE_REDIS', false); +# if ( ! defined(REDIS_CONNECT) ) +# define('REDIS_CONNECT', '/var/run/redis/redis.sock'); +# if ( ! defined(REDIS_DBNAME) ) +# define('REDIS_DBNAME', 1); + +# redirects to correct host +if ( $_SERVER['HTTP_HOST'] != HOST){ + header($_SERVER['SERVER_PROTOCOL']. ' 301 Moved Permanently'); + header('Location: ' . DOMAIN); + exit; +} + require(ABSPATH . 'functions.php'); require(ABSPATH . VFS_CLASS . 'mysql.php'); diff --git a/public_html/vfs_config.php b/public_html/vfs_config.php index 230a3b3..a24fdd1 100644 --- a/public_html/vfs_config.php +++ b/public_html/vfs_config.php @@ -9,22 +9,15 @@ define('DBCHARSET', 'utf8'); define('DBPREFIX', 'vfs_'); # absolute path -if( ! defined(ABSPATH) ) - define('ABSPATH', dirname(__FILE__) . '/'); +# define('ABSPATH', dirname(__FILE__) . '/'); # file directory -define('FILEPATH', ABSPATH . '/../files'); +# define('FILEPATH', ABSPATH . '../files'); -# scheme, set to http if set, otherwise plain http -if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') - define('SCHEME', 'https://'); -else - define('SCHEME', 'http://'); +# scheme, set to https if possible, otherwise plain http +# define('SCHEME', 'http://'); +# define('SCHEME', 'https://'); # hostname -define('HOST', $_SERVER['HTTP_HOST']); -define('DOMAIN', SCHEME . HOST); - -# redis access -define('REDIS_DBNAME', 1); -define('REDIS_CONNECT', '/var/run/redis/redis.sock'); +# define('HOST', 'files.iamfabulous.de'); +# define('DOMAIN', 'https://files.iamfabulous.de'); |
