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/structura.komma.pro/routes/oldRoutes.php
<?php

// Redirect old routes
$location = '';
$path = \Request::path();

switch($path)
{
    case 'content/index.htm':
        redirectOldRoute('/');
        break;
    case 'content/profiel.htm':
        redirectOldRoute('/');
        break;
    case 'content/tsg.htm':
        redirectOldRoute('nl/tsg-spuitgieten');
        break;
    case 'content/informatie.htm':
        redirectOldRoute('nl/contact');
        break;
    case 'content/contact.htm':
        redirectOldRoute('nl/contact');
        break;
    case 'content/route.htm':
        redirectOldRoute('nl/contact');
        break;
    case 'content/eindproducten.htm':
        redirectOldRoute('nl/tsg-spuitgieten');
        break;
    case 'content':
        redirectOldRoute('/');
        break;

}

if(starts_with($path, ['frames', ])) redirectOldRoute(null);
if(starts_with($path, ['uk', ])) redirectOldRoute('en');

// Redirect the old route
function redirectOldRoute($location, $responseCode = 302)
{

    $sitePath = '';

    if(isset($location) && $location!= '/')
        $location = $sitePath. '/' . $location;
    else
        $location = '/';
    header('location: '.$location, true, $responseCode);
    exit;
}