서버에서 도메인을 Redirect 하는 방법을 알려주세요.

0 투표
373 조회
서버 설정을 이용해서 요청한 도메인을 다른 도메인으로 연결시키고 싶습니다.

어떻게 설정하는지요?
요청 : 2015년 3월 10일 리눅스 분류 내 작성자 query (2,020 포인트)

1 개의 답변

0 투표

1. HTML 코드를 이용하는 방법

<META HTTP-EQUIV="Refresh" Content="0; URL=http://www.cydemy.com">
<!-- or -->
<html>
<head>
<META HTTP-EQUIV="Refresh" Content="3; URL=http://www.cydemy.com">
</head>
<body>
<p>3초 후에 새로운 도메인으로 연결됩니다.</p>
</body>
</html>
    

2. PHP 코드를 이용하는 방법

<?php
header("Location: http://www.cydemy.com/");
?>

3. 자바스크립트를 이용하는 방법

<html>
<head>
<script language="Javascript" type="text/javascript">
window.location.href="http://www.cydemy.com/"	    
</script>
</head>
</html>

4. Apache Module

<VirtualHost XXX.XXX.XXX.XXX>
ServerName www.queryshot.com
Redirect / http://www.cydemy.com/
</VirtualHost>

<참고>

http://www.yolinux.com/TUTORIALS/ApacheRedirect.html

답변: 2015년 3월 10일 작성자 queryeditor (5,040 포인트)