feat: ✨ make the website load for different subdomains
This commit is contained in:
parent
f00e97d294
commit
d39595d577
4 changed files with 80 additions and 54 deletions
|
@ -7,7 +7,20 @@ require_once 'vendor/autoload.php';
|
|||
require_once 'post_adapter.php';
|
||||
require_once 'fontawesome.php';
|
||||
|
||||
$adapter = new PostHandler();
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
$SERVER_HOST = $_SERVER['HTTP_HOST'];
|
||||
if(!preg_match('/^[\w\.]+$/', $SERVER_HOST)) {
|
||||
die();
|
||||
}
|
||||
|
||||
$SERVER_PREFIX = "https://" . $SERVER_HOST;
|
||||
|
||||
$SITE_CONFIG = Yaml::parseFile('secrets/' . $SERVER_HOST . '.config.yml');
|
||||
$SITE_CONFIG['uri_prefix'] = $SERVER_PREFIX;
|
||||
$SITE_CONFIG['HTTP_HOST'] = $SERVER_HOST;
|
||||
|
||||
$adapter = new PostHandler($SITE_CONFIG);
|
||||
|
||||
$loader = new \Twig\Loader\FilesystemLoader(['./templates', './user_content']);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue