<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta charset="utf-8">
    <meta http-equiv="Content-type" content="text/html;charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>HDV - Lỗi 404-Nội dung không tìm thấy</title>
    <link href="/img/favicon1.ico" rel="icon" type="image/ico">
    <link href="assets/global/css/bootstrap.min.css" rel="stylesheet">
    <link href="assets/global/css/font-awesome.min.css" rel="stylesheet">
    <link href="assets/global/css/404.webstore.css" rel="stylesheet">
</head>

<body>
    <!--start-wrap-->
    <div class="wrap">
        <!--start-header-->
        <div class="header">
            <div class="logo">
                <h1><a href="#">Ohh</a></h1>
            </div>
        </div>
        <!---End-header-->
        <!--start-content-->
        <div class="content">
            <img src="https://i.imgur.com/whAnpUe.png" title="Lỗi" />
            <p id="urlNotFound" class="hide"><span><label>O</label>hh.....</span>Trang web bạn yêu cầu không tồn tại</p>
            <a id="home" href="/">Về trang chủ</a>
            <a id="register" href="#" class="hide">Đăng ký cửa hàng</a>
        </div>
        <!--End-Cotent-->
    </div>
    <!--End-wrap-->
    <script type="text/javascript">
    var domains = ['vn', 'org', 'com'];
    var pathname = window.location.pathname;
    var hostUrl = window.location.host;
    var hosts = hostUrl.split('.');
    var $register = document.getElementById('register');
    var $storeNotFound = document.getElementById('storeNotFound');
    var $urlNotFound = document.getElementById('urlNotFound');
    var $home = document.getElementById('home');
    $register.setAttribute('href', window.location.protocol + '//' + hostUrl + '/bang-gia');
    if (pathname === '/cua_hang_khong_ton_tai') {
        // neu co subdoimain thi remove no roi set lai link cua home, register
        // local -> length ==2;
        if (hosts.length === 2 || (hosts.length > 2 && domains.indexOf(hosts[hosts.length - 1]) > -1)) {
            hosts.splice(0, 1);
            hostUrl = hosts.join('.');
            $home.setAttribute('href', window.location.protocol + '//' + hostUrl);
            $register.setAttribute('href', window.location.protocol + '//' + hostUrl + '/bang-gia');
        }
        $storeNotFound.classList.remove("hide");
        $register.classList.remove("hide");
    } else {
        $urlNotFound.classList.remove("hide");
        if (hosts[0] === 'id') {
            hosts.splice(0, 1);
            $home.setAttribute('href', window.location.protocol + '//' + hosts.join('.'));
        }
    }
    </script>
</body>

</html>
