그누보드 상대경로로 변경
안녕하세요.
이번에 운영중이던 홈페이지들을 SSL을 적용하면서 풀 URL로 저장되는 로직이 곳곳에 있는바람에
불편을 겪게 되어 상대경로로 변경하는 부분을 간단하게 적어봅니당.
혹시나 저도 나중에 사용하게 될 것 같기도 하고,
제가 놓친 부분이 있는지도 확인할 겸 해서요 ^^;
1. 에디터 저장 경로 변경
스마트 에디터의 경우
/plugin/editor/smarteditor2/photo_uploader/popup/php/index.php
변경 전 : $data_url = G5_DATA_URL.'/editor/'.$ym.'/';
변경 후 : $data_url = '/'.G5_DATA_DIR.'/editor/'.$ym.'/';
채디터의 경우
/plugin/editor/cheditor5/imageUpload/config.php
변경 전 : $data_url = G5_DATA_URL.'/editor/'.$ym.'/';
변경 후 : $data_url = '/'.G5_DATA_DIR.'/editor/'.$ym.'/';
에디터에 있는 이미지를 도메인이 다른 랜딩페이지에서 쓸 경우
$url = str_replace('http://','//',G5_DATA_URL);
$url = str_replace('https://','//',$url);
$url = str_replace(':443','',$url);
$data_url = $url.'/editor/'.$ym.'/';
경로를 //도메인/editor/~ 로 되도록 수정
2. /lib/common.lib.php view_file_link함수
변경 전 : $img .= '<img src="'.G5_DATA_URL.'/file/'.$board['bo_table'].'/'.urlencode($file).'" alt="'.$content.'" '.$attr.'>';
변경 후 : $img .= '<img src="/'.G5_DATA_DIR.'/file/'.$board['bo_table'].'/'.urlencode($file).'" alt="'.$content.'" '.$attr.'>';
3. /lib/thumbnail.lib.php get_list_thumbnail함수
변경 전 : $ori = G5_DATA_URL.'/file/'.$bo_table.'/'.$filename;
$src = G5_DATA_URL.'/file/'.$bo_table.'/'.$tname;
변경 후 : $ori = '/'.G5_DATA_DIR.'/file/'.$bo_table.'/'.$filename;
$src = '/'.G5_DATA_DIR.'/file/'.$bo_table.'/'.$tname;
4. /lib/latest.lib.php latest 함수
변경 전 : $latest_skin_url = str_replace(G5_PATH, G5_URL, $latest_skin_path);
변경 후 : $latest_skin_url = str_replace(G5_PATH, G5_URL, $latest_skin_path);
$latest_skin_url = str_replace( G5_URL, '', $latest_skin_url); 아래에 추가
아직까지 발견된건 여기까지인데.. 혹시라도 더 추가로 변경해주어야 하는 부분 있으면 조언 부탁드립니다 .ㅠㅠ
댓글 10개
참고 하겠습니다.
그누보드5/config.php 에 아래의 상수를 추가하고 그것을 editor 등에 적용하는것이 좋을듯 합니다.
define('G5_ROOT_DIR', '/'); // 그누보드를 root (http://abc.com)에 설치한 경우
//define('G5_ROOT_DIR', '/g5/'); // 그누보드를 http://abc.com/g5에 설치한 경우
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 3년 전 | 4409 | ||
| 1014 | 7년 전 | 6938 | ||
| 1013 | 7년 전 | 3936 | ||
| 1012 | 7년 전 | 5029 | ||
| 1011 | 7년 전 | 5424 | ||
| 1010 | 7년 전 | 4479 | ||
| 1009 | 7년 전 | 3788 | ||
| 1008 |
|
7년 전 | 5008 | |
| 1007 |
|
7년 전 | 5737 | |
| 1006 | 7년 전 | 18328 | ||
| 1005 | 7년 전 | 6315 | ||
| 1004 |
|
7년 전 | 4770 | |
| 1003 | 7년 전 | 9425 | ||
| 1002 | 7년 전 | 10500 | ||
| 1001 | 7년 전 | 3990 | ||
| 1000 | 7년 전 | 5690 | ||
| 999 | 7년 전 | 8997 | ||
| 998 | 7년 전 | 4239 | ||
| 997 | 7년 전 | 8351 | ||
| 996 | 7년 전 | 6622 | ||
| 995 | 7년 전 | 5154 | ||
| 994 | 7년 전 | 4517 | ||
| 993 |
|
7년 전 | 7691 | |
| 992 |
onlymilk47
|
7년 전 | 7891 | |
| 991 | 7년 전 | 4928 | ||
| 990 | 7년 전 | 5770 | ||
| 989 | 7년 전 | 4449 | ||
| 988 | 7년 전 | 4794 | ||
| 987 | 7년 전 | 8552 | ||
| 986 | 7년 전 | 5387 | ||
| 985 | 7년 전 | 7481 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기