<?php

if (array_key_exists('REQUEST_URI', $_SERVER)) {
    switch (trim(trim($_SERVER['REQUEST_URI']), '/')) {
        case 'hr/kontakt':
        case 'en/contact':
        case 'sl/kontakt':
        case 'en/about-me':
            header('Location: /#kontakt');
            die();

        case 'en/references/moja-biba':
        case 'en/references/pom':
        case 'en/references/azm':
        case 'en/references/johann-puch-janez-puh-jursinci':
        case 'en/references/johann-puch-janez-puh-jursinci/is':
        case 'en/references/wine-cellar-krsko':
        case 'en/references/prima-touch':
        case 'en/references/paintball-klub-bolt':
            header('Location: /#spletne-strani');
            die();

        case 'en/references/pohorje-beef':
        case 'en/references/infashion':
            header('Location: /#tiskovine');
            die();

        case 'en/references/bio-sad':
        case 'en/references/ad-vita':
        case 'en/references/atrial':
            header('Location: /#branding');
            die();
    }
}

header('Location: /');
die();

header('HTTP/1.0 404 Not Found');

$prefix = '';
if (array_key_exists('HTTP_HOST', $_SERVER) && $_SERVER['HTTP_HOST'] !== 'localhost') {
    $prefix = '/';
}

?><!DOCTYPE html>
<html lang="en-us">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="Content-language" content="en">
    <meta name="language" content="en">
    <title><?php echo array_key_exists('HTTP_HOST', $_SERVER)? htmlspecialchars($_SERVER['HTTP_HOST']) : '?'; ?></title>

    <link href="https://fonts.googleapis.com/css?family=Lato:400,700" rel="stylesheet">
    <link rel="stylesheet" href="<?php echo $prefix; ?>css/icons.css">
    <link rel="stylesheet" href="<?php echo $prefix; ?>style404.css">
    <link rel="shortcut icon" type="image/x-icon" href="<?php echo $prefix; ?>favicon.ico">

</head>
<body>
    <div class="out">
        <h1><i class="icon-debug"></i> <span>404</span> Not Found</h1>
        <?php
        $path = trim(trim($_SERVER['REQUEST_URI']), '/');
        if (!empty($path)) { ?>
            <p><?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?></p>
        <?php } ?>
    </div>
</body>
</html>