특정페이지로 순간 이동(http Redirection)하기
말그대로 유저가 홈페이지 접속시 특정페이지로 보내는 방법입니다.
◆ 방법 1 - 메타태그를 이용하는 방법.
================================================
아래 소스를 <head> 와 </head> 사이에 삽입
<meta http-equiv="refresh" content="0; url=넘어갈 주소">
◆ 방법 2 - PHP
=======================================================
<?php
// header 이용
$URL="넘어갈 주소";
header ("Location: $URL");
◆ 방법 3 - ASP
=======================================================
<%
'header 이용
strURL = "list.asp"
response.redirect strURL
' javascript 이용
response.write("<script>" & vbCrLf)
response.write("parent.location.replace('" & gRedirect & "');")
response.write(vbCrLf & "</script>")
%>
◆ 방법 4 - 자바스크립트 이용
===============================================
◆ location.href 를 쓸때
프레임을쓸 경우에는 아래와 같이 상위 프레임의 이름을 써주고 href를 써줘야 한다
예로 top프레임에서 location.href를 쓰고 target이 제자리에서 맴돌 경우
위 부모 parent써주고 목적이 되는 target 프레임의 이름을 써준다
parent.body.location.href=
참고자료
http://www.haneng.com/asp-forum/Response.Redirect--w-Target-_top_10930.html