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/SBogers10/fietsparkeer.komma-mediadesign.nl/wwwroot/index.php
<?php
/*
 * Make sure the user is visiting www.example.com instead of example.com
 */

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;
}


/*
if(substr($_SERVER['HTTP_HOST'],0,3) != 'www')
{
    header ('HTTP/1.1 301 Moved Permanently');
    $location = 'http://www.mecurity-fietsparkeer.nl';
    if( ! empty($_SERVER['REQUEST_URI'])) $location .= $_SERVER['REQUEST_URI'];
    header('location: ' . $location);
    exit;
}

if($_SERVER['HTTP_HOST'] != "www.mecurity-fietsparkeer.nl"){
    header ('HTTP/1.1 301 Moved Permanently');
    $location = "http://www.mecurity-fietsparkeer.nl";
    header('location: ' . $location);
    exit;
}*/



/*
 * Initialize
 */
include 'mvc/init.php';


// DB Connect
include 'kms/config/connect.php';
require_once 'kms/lib/general/db_handler.class.php';
require_once 'kms/lib/general/functions.class.php';
DEFINE('TABLE_PREFIX','');

/*
 * Load main controller in Template
 */
$Template->load(DOCUMENT_ROOT.'mvc/controllers/c_main.php','');

/*
 * Check if the URL_PAGE (get variable) is set.
 * If not, then load home page.
 */
if(defined('URL_PAGE'))
{
    if(URL_PAGE == "fietsparkeer"){
        header ('HTTP/1.1 301 Moved Permanently');
        $location = "/fietsparkeren";
        header('location: ' . $location);
        exit;
    }

    /*
     * Set page_name data
     * page_name is being used as class_name in header & footer
     */
    $Template->setData('page_name','page_'.URL_PAGE);

    $fietsparkeerPages = array('fietsparkeren','fiets-etagerekken','fietsstandaard','fietsrekken','fiets-aanleunbeugel','fiets-ophangrekken','fiets-overkappingen');

    /*
     *
     * Check if page is allowed.
     * If so, include the controller in the template. Else header a 404-error.
     */
    if(in_array(URL_PAGE,$fietsparkeerPages))
    {
        $Template->load(DOCUMENT_ROOT.'mvc/controllers/c_fietsparkeer.php');
    }
    else if(in_array(URL_PAGE,$allowedPages))
    {
        $page = str_replace('-','_',URL_PAGE);
        $Template->load(DOCUMENT_ROOT.'mvc/controllers/c_'.$page.'.php');
    }
    else{
        $Template->notFound();
    }
}
else{
    $Template->setData('page_name','page_home');
    $Template->setData('page_title', SITE_NAME);
    $Template->load(DOCUMENT_ROOT.'mvc/controllers/c_home.php');
}

/*
 * Load Views
 */
$Template->load(DOCUMENT_ROOT.'mvc/views/includes/v_header.php');
$Template->load($Template->getData('content_view_path',FALSE));
$Template->load(DOCUMENT_ROOT.'mvc/views/includes/v_footer.php');