<style>
    *{
        transition: all 0.6s;
    }

    html {
        height: 100%;
    }

    body{
        background: #fff;
        font-family: 'Lato', sans-serif;
        color: #888;
        margin: 0;
    }
    .window{
        background: #fff;
    }
    #main{
        display: table;
        width: 100%;
        height: 100vh;
        text-align: center;
    }

    .fof{
        display: table-cell;
        vertical-align: middle;
    }

    .fof h1{
        font-size: 50px;
        display: inline-block;
        padding-right: 12px;
        animation: type .5s alternate infinite;
    }

    @keyframes type{
        from{box-shadow: inset -3px 0px 0px #888;}
        to{box-shadow: inset -3px 0px 0px transparent;}
    }
</style>
<div id="main">
    <div class="page-loader"></div>
    <div class="fof">
        <div class="page-loader"></div>
        <h1><button onclick="redirectPageFromError2()" style="color: #ff0000"><?php echo $this->lang->line('page_not_found') ?></button></h1>
    </div>
</div>
<script type="text/javascript">
    $(function () {
        redirectPageFromError();
    });
    function redirectPageFromError() {
        var redirectUrl = localStorage.getItem('userAccessUrl');
        if ($.trim(redirectUrl)) {
            var UrlArr = redirectUrl.split('/');
            if (UrlArr.length >= 3) {
                if (UrlArr.indexOf('user') && UrlArr.indexOf('login')) {
                    window.location.href = redirectUrl;
                } else {
                    window.location.href = '<?php echo site_url() ?>';
                }
            }
        } else {
            window.location.href = '<?php echo site_url() ?>';
        }
    }
    function redirectPageFromError2() {
        $('.page-loader').hide();
        window.location.href = '<?php echo site_url() ?>';
    }
</script>
