웹호스팅 계정에
/m1
/m2
/m3
/m4
를 각각
m1.도메인.co.kr
m2.도메인.co.kr
m3.도메인.co.kr
m4.도메인.co.kr
로 운영중입니다.
물론
도메인.co.kr 도 운영 중입니다.
여기다가
도메인.co.kr에 /bbs 포더를 만들어서 게시판을 만들고
m1.도메인.co.kr/bbs
m2.도메인.co.kr/bbs
m3.도메인.co.kr/bbs
m4.도메인.co.kr/bbs
처럼 쓸려면 어떻게 해야 하나요?
simbolic link 를 아래처럼 쓰라고 하시는데 유연한 적용을 위해 rewrite 로 구현을 했으면 합니다.
ln -s /도메인/bbs /m1/bbs
ln -s /도메인/bbs /m2/bbs
ln -s /도메인/bbs /m3/bbs
ln -s /도메인/bbs /m4/bbs
현재 .htaccess 파일 내용
<ifmodule mod_rewrite.c>RewriteEngine OnRewriteBase / RewriteCond %{HTTP_HOST} ^도메인.co.kr$ [NC]RewriteRule ^(.*)$ http://www.도메인.co.kr/$1 [R=301,L] #RewriteCond %{HTTP_HOST} ^www.도메인.co.kr$ [NC]#RewriteRule ^(.*)$ http://도메인.co.kr/$1 [R=301,L]# www 서브도메인을 이용하지 않음 RewriteCond %{HTTP_HOST} ^m1.도메인.co.kr [NC] RewriteCond $1 !^(m1)/ RewriteRule ^(.*)$ /m1/$1 [L] # m1 서브도메인은 m1 디렉토리 연결 RewriteCond %{HTTP_HOST} ^m2.도메인.co.kr [NC] RewriteCond $1 !^(m2)/ RewriteRule ^(.*)$ /m2/$1 [L] # m2 서브도메인은 m2 디렉토리 연결 RewriteCond %{HTTP_HOST} ^m3.도메인.co.kr [NC] RewriteCond $1 !^(m3)/ RewriteRule ^(.*)$ /m3/$1 [L] # m3 서브도메인은 m3 디렉토리 연결 RewriteCond %{HTTP_HOST} ^m4.도메인.co.kr [NC] RewriteCond $1 !^(m4)/ RewriteRule ^(.*)$ /m4/$1 [L] # m4 서브도메인은 m4 디렉토리 연결</ifmodule>
주제에 맞지 않는 질문글 올려 죄송합니다만... 넘 급해서
다른 도메인에 있는 그누보드를 동시 사용 하려고 하다 보니...
관련 질문 카테고리도 없고 여기에 개발자분들이 많고 해서요...
따로 말씀 주시면 자삭 또는 이동 시키겠습니다.
댓글 5개
제가 쓰는 방법인데요
/home/www 에 디렉토리를 만들면 서브 도메인으로 바로 사용 할 수 있도록해서 사용하고있네요
/home/www/m1 만들었다면 웹에서 m1.myhome.com 으로 바로 사용 할 수 있어요.
<VirtualHost *:80>
DocumentRoot /home/www/myhome.com
ServerName myhome.com
ServerAlias *.myhome.com
RewriteEngine on
RewriteCond %{HTTP_HOST} ^[^.]+.myhome.com$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^([^.]+).myhome.com(.*) /home/www/$1/$2
ErrorLog logs/myhome.com.host-error_log
CustomLog logs/myhome.com.host-access_log combined
</VirtualHost>
/home/www 에 디렉토리를 만들면 서브 도메인으로 바로 사용 할 수 있도록해서 사용하고있네요
/home/www/m1 만들었다면 웹에서 m1.myhome.com 으로 바로 사용 할 수 있어요.
<VirtualHost *:80>
DocumentRoot /home/www/myhome.com
ServerName myhome.com
ServerAlias *.myhome.com
RewriteEngine on
RewriteCond %{HTTP_HOST} ^[^.]+.myhome.com$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^([^.]+).myhome.com(.*) /home/www/$1/$2
ErrorLog logs/myhome.com.host-error_log
CustomLog logs/myhome.com.host-access_log combined
</VirtualHost>
게시글 목록
| 번호 | 제목 |
|---|---|
| 27980 | |
| 7164 | |
| 31729 | |
| 31726 | |
| 31725 | |
| 31720 | |
| 31711 | |
| 7159 | |
| 27974 | |
| 19734 | |
| 19730 | |
| 19729 |
PHP
[알고리즘] 배열 역순
|
| 27969 | |
| 7142 | |
| 19728 |
jQuery
remove()를 이용하여 엘리먼트 삭제하기
|
| 19725 | |
| 7130 | |
| 19722 |
jQuery
동일 엘리먼트 순번 알아내기
2
|
| 19719 | |
| 7124 | |
| 19718 | |
| 19717 | |
| 19716 |
jQuery
position() 메서드 객체에 대한 좌표값
|
| 19715 | |
| 7122 | |
| 30959 | |
| 19714 | |
| 31710 |
jQuery Mobile
jQuery Mobile 강좌 19. Select Menus
|
| 31709 |
jQuery Mobile
jQuery Mobile 강좌 18. Text Inputs
|
| 19713 | |
| 7117 | |
| 19712 | |
| 7111 | |
| 31708 |
jQuery Mobile
jQuery Mobile 강좌 17. Form Basic
|
| 31707 |
jQuery Mobile
jQuery Mobile 강좌 16. Filters
|
| 19710 | |
| 31706 |
jQuery Mobile
jQuery Mobile 강좌 15. List Content
|
| 31705 |
jQuery Mobile
jQuery Mobile 강좌 14. List Views
|
| 31704 |
jQuery Mobile
jQuery Mobile 강좌 13. Layout Grids
|
| 19709 | |
| 19707 | |
| 31703 |
jQuery Mobile
jQuery Mobile 강좌 12. Tables
|
| 19706 |
jQuery
class가 있는지 없는지 체크하기
|
| 31702 |
jQuery Mobile
jQuery Mobile 강좌 11. Collapsibles
|
| 19705 |
PHP
배열에서 중복 값 없애기
|
| 31701 |
jQuery Mobile
jQuery Mobile 강좌 10. Panels
|
| 19704 | |
| 31700 |
jQuery Mobile
jQuery Mobile 강좌 9. Navigation Bars
|
| 31699 |
jQuery Mobile
jQuery Mobile 강좌 8. Toolbars
|
| 31698 |
jQuery Mobile
jQuery Mobile 강좌 7. Popups
|
| 7107 | |
| 19703 |
JavaScript
str_pad 자릿수만큼 특정문자로 채우기
|
| 31697 |
jQuery Mobile
jQuery Mobile 강좌 6. Icons
|
| 31696 |
jQuery Mobile
jQuery Mobile 강좌 5. Buttons
|
| 19702 | |
| 19701 | |
| 31695 |
jQuery Mobile
jQuery Mobile 강좌 4. Transitions
|
| 27965 | |
| 31694 |
jQuery Mobile
jQuery Mobile 강좌 3. Pages
|
| 19700 | |
| 31693 |
jQuery Mobile
jQuery Mobile 강좌 2. Install
|
| 19699 | |
| 31692 |
jQuery Mobile
jQuery Mobile 강좌 1. Introduction
|
| 31691 |
jQuery Mobile
jQuery Mobile 강좌 0.home
|
| 19698 | |
| 19697 | |
| 19696 |
jQuery
마우스 오버 위치에 따라 툴팁 생성 및 자동 이동
|
| 19694 | |
| 19693 |
jQuery
제이쿼리 동적으로 생성된 객체에 이벤트 생성하기
|
| 19692 | |
| 19691 | |
| 19690 |
JavaScript
shuffle 배열섞기
|
| 19689 |
jQuery
제이쿼리 모음 사이트
|
| 19688 |
PHP
1원팁] IP 대역 비교
|
| 19687 | |
| 7105 | |
| 30955 | |
| 7100 | |
| 19681 |
PHP
input 쉽게 관리하기
5
|
| 7097 | |
| 19678 |
JavaScript
서버시간을 사용한 전자시계
2
|
| 7089 | |
| 7086 | |
| 7084 | |
| 7082 | |
| 19677 | |
| 30953 | |
| 7080 | |
| 7077 | |
| 7071 | |
| 7070 | |
| 7066 | |
| 19676 |
JavaScript
구글 웹사이트 번역기를 내 사이트에 달기
|
| 19674 | |
| 27961 | |
| 7063 | |
| 7061 | |
| 19669 | |
| 7060 | |
| 20842 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기