분류 그누보드

html, javascript, php, jquery등으로 사이트 이동하는 방법

컨텐츠 정보

  • 조회 3,429 (작성일 )

본문

HTML :

<!DOCTYPE html>

<html>

<head>

   <!-- HTML meta refresh URL redirection -->

   <meta http-equiv="refresh"

   content="0; url=http://www.365ok.co.kr">

</head>

<body>

   <p>이 사이트(페이지)는 이동되었습니다.:

   <a href="http://www.365ok.co.kr">기존사이트</a></p>

</body>

</html> 

 

Javascript :

<!DOCTYPE html>

<html>

<body>

<script type="text/javascript">

    // Javascript URL redirection

    window.location.replace("http://www.365ok.co.kr");

</script>

</body>

</html> 

 

jQuery : 

<!DOCTYPE html>

<html>

<body>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>

<script type="text/javascript">

   // jQuery URL redirection

   $(document).ready( function() {

      url = "http://www.365ok.co.kr";

      $( location ).attr("href", url);

   });

</script>

</body>

</html> 

 

PHP : 

<?php

// PHP permanent URL redirection

header("Location: http://www.365ok.co.kr", true, 301);

exit();

?>