고수님들 이 문제 좀 봐주실래요.
index.php 에 아래와 같이 넣어두었습니다. 도메인에 따라 다른 홈피가 뜨는 것이지요. 아래 코딩은 검증이 된거구요. 제가 다른 서버에서도 이렇게 사용하거든요.
<?
if ($_SERVER[HTTP_HOST]=="www.kkk.net") { $index="index1.html"; }
elseif ($_SERVER[HTTP_HOST]=="kkk.net") { $index="index1.html"; }
elseif ($_SERVER[HTTP_HOST]=="www.kkk.com") { $index="index2.html"; }
elseif ($_SERVER[HTTP_HOST]=="kkk.com") { $index="index2.html"; }
?>
<? include $index; ?>
하지만 kkk.net으로 접속시 아래와 같이 에러가 납니다. 그런데 kkk.net/index1.html 이렇게 주소를 직접 치면 에러가 없습니다. 무엇이 문제일까요?
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/common.php on line 8
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/lib/common.lib.php on line 98
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/lib/common.lib.php on line 98
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/lib/common.lib.php on line 98
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/head.sub.php on line 32
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/head.sub.php on line 34
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/head.sub.php on line 35
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/head.sub.php on line 36
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/head.sub.php on line 37
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/head.sub.php on line 38
<?
if ($_SERVER[HTTP_HOST]=="www.kkk.net") { $index="index1.html"; }
elseif ($_SERVER[HTTP_HOST]=="kkk.net") { $index="index1.html"; }
elseif ($_SERVER[HTTP_HOST]=="www.kkk.com") { $index="index2.html"; }
elseif ($_SERVER[HTTP_HOST]=="kkk.com") { $index="index2.html"; }
?>
<? include $index; ?>
하지만 kkk.net으로 접속시 아래와 같이 에러가 납니다. 그런데 kkk.net/index1.html 이렇게 주소를 직접 치면 에러가 없습니다. 무엇이 문제일까요?
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/common.php on line 8
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/lib/common.lib.php on line 98
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/lib/common.lib.php on line 98
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/lib/common.lib.php on line 98
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/head.sub.php on line 32
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/head.sub.php on line 34
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/head.sub.php on line 35
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/head.sub.php on line 36
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/head.sub.php on line 37
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/homeschooler/www/index.php:13) in /home/hosting_users/homeschooler/www/head.sub.php on line 38
|
댓글을 작성하시려면 로그인이 필요합니다.
댓글 6개
위치를 잘 넣으셔야 합니다..
그쪽엔
<?
if ($_SERVER[HTTP_HOST]=="www.kkk.net") { $index="index1.html"; }
elseif ($_SERVER[HTTP_HOST]=="kkk.net") { $index="index1.html"; }
elseif ($_SERVER[HTTP_HOST]=="www.kkk.com") { $index="index2.html"; }
elseif ($_SERVER[HTTP_HOST]=="kkk.com") { $index="index2.html"; }
?>
이 코드를 부르지 않을테니까요...
조치사항은 위처럼, 위치를 잘 바꿔보는 수밖엔 없습니다.
제가 풀 코드를 가지고 있는것도 아닌이상 더이상 답변을 드릴수는 없겠네요.
감사합니다.
<frameset rows='*' border='0'>
<frame name='frame' src='http://kkk.net/index1.html'>
</frameset>
아래와 같이 모든 공백 라인만 삭제하면 될 겁니다
<?
<----------- 공백라인 삭제
if ($_SERVER[HTTP_HOST]=="www.kkk.net") { $index="index1.html"; }
<------ 공백라인 삭제
?>
<------ 공백라인 삭제