웹마스터 팁
page_full_width">
(삽질완료) 다중도메인, 접속도메인따라 경로결정
2002.07.25 21:48
http://nrhythm.com/http://seenine.com/제가 도메인을 seenine.com하고 nrhythm.com 두개를 쓰는데
한 호스팅에서 두개의 도메인을 쓰는데 메인을 달리하려고 시도한 겁니다.
(삽질이 길었습니다...)
잘 쓰면 호스팅은 한곳이지만 두곳에서 쓰는 효과를 누릴 수 있습니다.
<!--
이 6줄을 적당히 손봐주세요.
www를 붙일때와 안붙일때 차이가 나서...
-->
<?
if ($_SERVER[HTTP_HOST]=="seenine.com") { $index="http://seenine.com/seenine.html"; }
elseif ($_SERVER[HTTP_HOST]=="www.seenine.com") { $index="http://seenine.com/seenine.html"; }
elseif ($_SERVER[HTTP_HOST]=="nrhythm.com") { $index="http://nrhythm.com/nrhythm.html"; }
elseif ($_SERVER[HTTP_HOST]=="www.nrhythm.com") { $index="http://nrhythm.com/nrhythm.html"; }
?>
<html>
<head>
<title>타이틀입니다.</title>
</head>
<frameset rows="100%" cols="1*" border="0">
<frame src="<?=$index?>" name="프레임명 적당히수정" scrolling="yes" marginwidth="0" marginheight="0">
</frameset>
</html>
프레임이 싫으시면 header 혹은 메타태그등 자동이동 경로를 만들어주세요.
(메인만 이러는 이유는 다른 페이지부터 폴더를 달리하기 때문입니다 - 위 경우에서는 말입니다)
한 호스팅에서 두개의 도메인을 쓰는데 메인을 달리하려고 시도한 겁니다.
(삽질이 길었습니다...)
잘 쓰면 호스팅은 한곳이지만 두곳에서 쓰는 효과를 누릴 수 있습니다.
<!--
이 6줄을 적당히 손봐주세요.
www를 붙일때와 안붙일때 차이가 나서...
-->
<?
if ($_SERVER[HTTP_HOST]=="seenine.com") { $index="http://seenine.com/seenine.html"; }
elseif ($_SERVER[HTTP_HOST]=="www.seenine.com") { $index="http://seenine.com/seenine.html"; }
elseif ($_SERVER[HTTP_HOST]=="nrhythm.com") { $index="http://nrhythm.com/nrhythm.html"; }
elseif ($_SERVER[HTTP_HOST]=="www.nrhythm.com") { $index="http://nrhythm.com/nrhythm.html"; }
?>
<html>
<head>
<title>타이틀입니다.</title>
</head>
<frameset rows="100%" cols="1*" border="0">
<frame src="<?=$index?>" name="프레임명 적당히수정" scrolling="yes" marginwidth="0" marginheight="0">
</frameset>
</html>
프레임이 싫으시면 header 혹은 메타태그등 자동이동 경로를 만들어주세요.
(메인만 이러는 이유는 다른 페이지부터 폴더를 달리하기 때문입니다 - 위 경우에서는 말입니다)
$host = $_SERVER[HTTP_HOST];
if (eregi("abc.com", $host)) $index="http://abc.com/abc.html";
if (eregi("apple.com", $host)) $index="http://apple.com/apple.html";
[;]