그누팁은 아니지만 도메인 별로 디렉토리 접속하기 정보
그누팁은 아니지만 도메인 별로 디렉토리 접속하기
본문
<?
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;
?>
추천
6
6
댓글 15개

허접하지만 그래도 쓸모가 아주 많은 것 같아요. 물론 위 소스를 계정의 디폴트 파일로 만들어놓으면..
index.html , index.php , default.html 등등으로 올리고 도메인과 디렉토리 파일명을 수정하면 됩니다.
index.html , index.php , default.html 등등으로 올리고 도메인과 디렉토리 파일명을 수정하면 됩니다.

멋지네요 좋은 정보 감사 합니다

허접한 팁에 칭찬 감사합니다.

좋은 자료 감사합니다^^*
가끔 이렇게 해보고 싶을때가 있긴 했었습니다^^*
나중에 한번 해보겠습니다^^*
가끔 이렇게 해보고 싶을때가 있긴 했었습니다^^*
나중에 한번 해보겠습니다^^*

예^^ 잘만 활용하면요^^

좋은팁 감사합니다

허접한 팁에 칭찬 감사합니다.

좋은 정보 감사합니다. ^^

허접한 팁에 칭찬 감사합니다.
서버라면 버츄얼호스트 사용하는것이 더 효율적일거 같습니다.
좋은 방법이네요^^
좋은 방법이네요^^

당연하죠^^
좋은 정보 감사합니다

허접한 팁에 칭찬 감사합니다.
좋은 팁 감사합니다~~~^^

허접한 팁에 칭찬 감사합니다.