하나의 서버에서 여러개 사이트를 한개의 ROOT안에 서브 디렉토리로 운영시???
home / test1 / public_html / 안에
각각의 서브 디렉토리를 두고 각 서브 디렉토리가 사이트가 되는 구조로 운영하고 있습니다.
aaa.com -> home / test1 / public_html / aaa / 이런식으로요.
httpd.conf 안에서도
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/home/test1/public_html"
ServerName test1.co.kr
ServerAlias test1.co.kr www.test1.co.kr
RewriteEngine on
RewriteCond %{HTTP_HOST} ^test1.co.kr
RewriteRule (.*) http://www.test1.co.kr$1 [R=301,L]
ErrorLog "logs/test1.co.kr-error_log"
CustomLog "logs/test1.co.kr-access_log" common
</VirtualHost>
답변 5개 / 댓글 3개
아 그러시면 기존대로 유지하시고요. 그냥
common.php 에다가요.
if($_SERVER['SERVER_NAME'] =="aaa.com")
{
header("Location:aaa.com/aaa" . $_SERVER['QUERY_STRING'] );
}
else if($_SERVER['SERVER_NAME'] =="bbb.com")
{
header("Location:bbb.com/bbb" . $_SERVER['QUERY_STRING'] );
}
그냥 예제입니다.
위 처럼 별도 도메인에 DocumentRoot를 잡아주셔야 다른 디렉토리 접근이 되지 않습니다.
이런식으로 하면 되지 않나요?
<VirtualHost *:80>
DocumentRoot "/home/test/public/aa"
ServerName aa.com
<Directory "/home/test/public/aa">
Options Indexes Includes execCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/home/test/public/bb"
ServerName bb.com
<Directory "/home/test/public/bb">
Options Indexes Includes execCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost 111.22.33.44>
ServerName www.customer-1.com
DocumentRoot /www/hosts/www.customer-1.com/docs
< /VirtualHost>
< VirtualHost 111.22.33.44>
ServerName www.customer-2.com
DocumentRoot /www/hosts/www.customer-2.com/docs
< /VirtualHost>
답변에 대한 댓글 1개
답변을 작성하려면 로그인이 필요합니다.
"
페이지 자동 바꾸기가 제대로 안 됨
이 주소에 대하여 완전하지 못한 방법의 연결 이동 요청이 감지되었습니다.
이 문제는 드물게 해당 사이트에서 요구하는 쿠키를 차단하여 발생할 수 있습니다.
"
이런 메세지가나오네요 ㅠ.ㅜ