테스트 사이트 - 개발 중인 베타 버전입니다

A 와 B 도메인

· 14년 전 · 1504 · 5
A 와 B 도메인

A 도메인은 지금껏 사용중이였고

B 도메인은 새로 구입하여서 B도메인으로 평생 사용할려 합니다

그런데 A 도메인으로 많은 회원분들이 접속을 하고있기떄문에

B도메인으로 알릴려 합니다. 그래서

A도메인 접속시 B 도메인으로 자동으로 이동되거나 혹,

A도메인 접속시 B도메인으로 접속하라는 경고창을 띄우고싶은데

이런 방법을 몰라 질문남겨봅니다.

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 5개

<?
if(eregi("a.com", $_SERVER['HTTP_HOST'])){
?>
<script>
location.href="http://b.com";
</script>
<?
exit;
}
?>
어디 파일에 넣으면 될런지요 head.sub.php 에 넣었는데 상단에 6개정도 에러가발생합니다

Warning: Cannot modify header information - headers already sent by (output started at /home/dusekffo/head.sub.php:2) in /home/head.sub.php on line 33

Warning: Cannot modify header information - headers already sent by (output started at /home/dusekffo/head.sub.php:2) in /home/head.sub.php on line 35

Warning: Cannot modify header information - headers already sent by (output started at /home/dusekffo/head.sub.php:2) in /home/head.sub.php on line 36

Warning: Cannot modify header information - headers already sent by (output started at /home/dusekffo/head.sub.php:2) in /home/head.sub.php on line 37

Warning: Cannot modify header information - headers already sent by (output started at /home/dusekffo/head.sub.php:2) in /home/head.sub.php on line 38

Warning: Cannot modify header information - headers already sent by (output started at /home/dusekffo/head.sub.php:2) in /home/head.sub.php on line 39
39 라인
header("Content-Type: text/html; charset=$g4[charset]");
$gmnow = gmdate("D, d M Y H:i:s") . " GMT";
header("Expires: 0"); // rfc2616 - Section 14.21
header("Last-Modified: " . $gmnow);
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: pre-check=0, post-check=0, max-age=0"); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/1.0

아래에 넣으세요
index.php 나 head.sub.php 등 에요..
index.php 에 넣으면 메인에서만 처리될 테고 head에 넣으면 모든 경로에서 처리하겠죠...
head에 넣으려면 도메인 뒤의 값들을 처리해서 추가하면 됩니다.
도메인 뒤의 값들은 $_SERVER['REQUEST_URI']
네 감사합니다

게시글 목록

번호 제목
284508
284499
284492
284490
284484
284481
284478
284476
284474
284472
284470
284458
284457
284454
284453
284447
284446
284444
284441
284440