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/config/komma_fix.php
<?php
/**
 * komma_fix.php
 * Created by Komma Mediadesign.
 * Author: mike
 * Date: 10/12/13
 */


// Replace GET ( was done in htaccess )
$stringUrl = substr($_SERVER['REQUEST_URI'],1);
$urls = explode('/', $stringUrl);


$urlcount = 0;

if(isset($urls[$urlcount]) && $urls[$urlcount] == 'admin')
{
    $urlcount++;
}


if(isset($urls[$urlcount]))
{   $page = trim(urldecode($urls[$urlcount]));
    if(!empty($page))
    {
        $_GET['page'] = $page;
        $urlcount++;
    }
}
if(isset($urls[$urlcount]))
{   $sub = trim(urldecode($urls[$urlcount]));
    if(!empty($sub))
    {
        $_GET['sub'] = $sub;
        $urlcount++;
    }
}
if(isset($urls[$urlcount]))
{   $sub2 = trim(urldecode($urls[$urlcount]));
    if(!empty($sub2))
    {
        $_GET['action'] = $sub2;
        $urlcount++;
    }
}
if(isset($urls[$urlcount]))
{   $sub3 = trim(urldecode($urls[$urlcount]));
    if(!empty($sub3))
    {
        $_GET['id'] = $sub3;
    }
}



// Error
if($_SERVER['REMOTE_ADDR'] == '212.61.130.133')
{
    ini_set('display_errors', 1);
    ini_set('log_errors', 1);
    ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
    error_reporting(E_ALL ^ E_WARNING);
    ini_set("display_errors", 1);
}
// 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;
}