HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers45/smuldersinterieurprojecten.nl/wwwroot/landing/init.php
<?php
/**
 * init.php
 * Created by Komma Mediadesign.
 * Author: mike
 * Date: 21/01/14
 */

// Define pages
$specific = array(); // specific page
$kitchen = array('keukens-heeze','keukens-leende','keukens-sterksel','keukens-geldrop','keukens-mierlo','keukens-nuenen'); // kitchen page

// Split url
$stringUrl = substr($_SERVER['REQUEST_URI'],1);
$urls = explode('/', $stringUrl);

// Header to www
if(substr($_SERVER['HTTP_HOST'],0,3) != 'www')
{
    header ('HTTP/1.1 301 Moved Permanently');
    $location = 'http://www.' . $_SERVER['HTTP_HOST'];
    if( ! empty($_SERVER['REQUEST_URI'])) $location .= $_SERVER['REQUEST_URI'];

    header('location: ' . $location);
    exit;
}

// Check if page
if( ! empty($urls[0]))
{
    $page = $urls[0];

    // Get kitchen + village
    if( in_array($page,$kitchen))
    {
        $temp = explode('-',$page);
        $city = $data['city'] = $temp[1];

        include $_SERVER['DOCUMENT_ROOT'] . '/landing/views/pages/kitchen.php';
    }
    else if( in_array($page,$specific))
    {
        $file = str_replace('-','_',$page);
        include $_SERVER['DOCUMENT_ROOT'] . '/landing/views/pages/' . $file . '.php';
    }
    else
    {
        // 404
        include $_SERVER['DOCUMENT_ROOT'] . '/landing/views/pages/404.php';
    }

    include $_SERVER['DOCUMENT_ROOT'] . '/landing/views/template.php';

    exit;
}