<?php
$json = file_get_contents("./data.json");
$json = mb_convert_encoding($json, 'UTF8', 'ASCII,JIS,UTF-8,EUC-JP,SJIS-WIN');
$data = json_decode($json, true);

$id = $_GET['id'];

if (isset($data[$id])) {
    header("Location:" . $data[$id], true, 301);
    exit();
}

header("HTTP/1.1 404 Not Found");
?>
<link rel="stylesheet" href="https://cdn.simplecss.org/simple.css" />
<link rel="stylesheet" href="https://dododoshirouto.github.io/dodo-simple.css/sample/dodo-simple.css" />

<?php if (!isset($_GET['id'])) { ?>
    <title>404 - このURLは無効になっています。</title>
<?php } else { ?>
    <title>404 - このURLは無効になっています。</title>
<?php } ?>
<p>404 - このURLは無効になっています。</p>