그누팁은 아니지만 도메인 별로 디렉토리 접속하기
<?
if (stristr($_SERVER[HTTP_HOST], "www.abc.com")) {
echo "<meta http-equiv='refresh' content='0; url=http://abc.com'>";
exit;
}
if (stristr($_SERVER[HTTP_HOST], "www.efg.com")) {
echo "<meta http-equiv='refresh' content='0; url=http://efg.com'>";
exit;
}
if (stristr($_SERVER[HTTP_HOST], "www.abc.com")) { $toLink = "./main/default.htm"; }
else if (stristr($_SERVER[HTTP_HOST], "abc.com")) { $toLink = "./main/default.htm"; }
else if (stristr($_SERVER[HTTP_HOST], "www.efg.com")) { $toLink = "./shop/index.htm"; }
else if (stristr($_SERVER[HTTP_HOST], "efg.com")) { $toLink = "./shop/index.htm"; }
else { echo "잘못된 주소입니다!!"; exit; }
include $toLink;
?>
if (stristr($_SERVER[HTTP_HOST], "www.abc.com")) {
echo "<meta http-equiv='refresh' content='0; url=http://abc.com'>";
exit;
}
if (stristr($_SERVER[HTTP_HOST], "www.efg.com")) {
echo "<meta http-equiv='refresh' content='0; url=http://efg.com'>";
exit;
}
if (stristr($_SERVER[HTTP_HOST], "www.abc.com")) { $toLink = "./main/default.htm"; }
else if (stristr($_SERVER[HTTP_HOST], "abc.com")) { $toLink = "./main/default.htm"; }
else if (stristr($_SERVER[HTTP_HOST], "www.efg.com")) { $toLink = "./shop/index.htm"; }
else if (stristr($_SERVER[HTTP_HOST], "efg.com")) { $toLink = "./shop/index.htm"; }
else { echo "잘못된 주소입니다!!"; exit; }
include $toLink;
?>
|
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기
댓글 15개
index.html , index.php , default.html 등등으로 올리고 도메인과 디렉토리 파일명을 수정하면 됩니다.
가끔 이렇게 해보고 싶을때가 있긴 했었습니다^^*
나중에 한번 해보겠습니다^^*
좋은 방법이네요^^