도메인 두개를 한 사이트에 연결시켰는데 링크를 이동할때마다 도메인이 서로 섞인다던지 엉키거나 꼬일때 해결방법을 기록해 둡니다.
먼저 /config.php 에서
아래의 코드를 찾습니다
[code]
define('G5_DOMAIN', '');
define('G5_HTTPS_DOMAIN', '');
[/code]
그리고 아래의 예시 코드로 변경합니다
aa.kr 도메인과 bb.kr 도메인을 변경해주세요
[code]
if (isset($_SERVER['HTTP_HOST'])) {
$current_host = $_SERVER['HTTP_HOST'];
if (strpos($current_host, 'aa.kr') !== false) {
define('G5_DOMAIN', 'https://aa.kr');
} else if (strpos($current_host, 'bb.kr') !== false) {
define('G5_DOMAIN', 'https://bb.kr');
} else {
// 기본 도메인 설정 (위 조건에 해당하지 않는 경우)
define('G5_DOMAIN', 'https://aa.kr');
}
} else {
// CLI 환경 (예: SSH)에서 실행될 경우
define('G5_DOMAIN', 'https://aa.kr');
}
define('G5_HTTPS_DOMAIN', ''); // 이 부분은 유지
[/code]
lib/latest.lib.php 파일을 찾아서
아래의 코드를 찾아서
[code]
if(G5_USE_CACHE) {
$cache_file_name = "latest-{$bo_table}-{$skin_dir}-{$rows}-{$subject_len}-".g5_cache_secret_key();
$caches = g5_get_cache($cache_file_name, (int) $time_unit * (int) $cache_time);
$cache_list = isset($caches['list']) ? $caches['list'] : array();
g5_latest_cache_data($bo_table, $cache_list);
}
[/code]
아래의 코드로 변경합니다
[code]
if(G5_USE_CACHE) {
// 캐시 키에 도메인 정보를 추가하여 도메인별로 캐시 파일이 생성되도록 수정
$domain_cache_key = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
$cache_file_name = "latest-{$domain_cache_key}-{$bo_table}-{$skin_dir}-{$rows}-{$subject_len}-".g5_cache_secret_key();
$caches = g5_get_cache($cache_file_name, (int) $time_unit * (int) $cache_time);
$cache_list = isset($caches['list']) ? $caches['list'] : array();
g5_latest_cache_data($bo_table, $cache_list);
}
[/code]
그리고 최종적으로 관리자모드에 접속하셔서 환경설정 -> 캐시파일 일괄삭제 를 진행해주시면 해결됩니다
이렇게 해도 안된다면 저는 모르니 QnA 에 문의를 ㅋㅋ..
게시글 목록
| 번호 | 제목 |
|---|---|
| 24149 | |
| 24140 | |
| 24133 | |
| 24125 | |
| 24119 | |
| 24109 | |
| 24105 | |
| 24101 | |
| 24093 | |
| 24089 | |
| 24077 | |
| 24074 | |
| 24071 | |
| 24070 | |
| 24067 | |
| 24056 | |
| 24050 | |
| 24046 | |
| 24043 | |
| 24040 | |
| 24037 | |
| 24036 | |
| 24035 | |
| 24034 | |
| 24021 | |
| 24017 | |
| 24005 | |
| 24002 | |
| 23990 | |
| 23980 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기