Web

Redirect page

아르비스 2016. 3. 4. 16:44

아래 코드 처럼 redirect 시킴

<!DOCTYPE HTML>

<html lang="en-US">

    <head>

        <meta charset="UTF-8">

        <meta http-equiv="refresh" content="1;url=https://aaa.bbb.net/cc">

        <script type="text/javascript">

            window.location.href = "https://aaa.bbb.net/cc"

        </script>

        <title>Welcome to Hell</title>

    </head>


</html>

위 코드는 직접 URL을 적용하는 방식


현재 URL을 가져와서 하위 URL로 변경하는 방식은.


<!DOCTYPE HTML>

<html lang="en-US">

    <head>

        <meta charset="UTF-8">

        <meta http-equiv="refresh" content="1;url=https://127.0.0.1/cc">

        <script type="text/javascript">

            var url = (window.location.protocol?window.location.protocol:"https:")+"//"+window.location.host+"/cc/#";

            window.location.href = url

        </script>

        <title>CellWe Collaboration</title>

    </head>


</html>