모바일 홈페이지를 이용하는 경우 m 으로 시작하는 도메인으로 자동 넘기고 싶을때
네이버에서 모바일 광고 승인이 거부되었다는 이야기를 듣고 알아보니 http://도메인 으로 모바일 홈페이지가 뜨면 최적화가 안되었다는 거부사유가 뜹니다.
모바일 기기에서 접속할때 http://www.happyjung.com 또는 http://happyjung.com 으로 접속할때 http://m.happyjung.com 으로 넘기는 방법입니다.
이것을 적용하기전에 도메인의 네임서버 설정에서 A 레코드를 추가해야합니다.
A 레코드 추가는 거래하는 웹호스팅사에 문의하세욤.
그누보드5 / 테마 / head.sub.php 의 내용을 이렇게 수정합니다.
< 방법1 >
<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<?php
if (G5_IS_MOBILE) {
를 아래와 같이 변경합니다.
<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<?php
if (G5_IS_MOBILE) {
$hp_index_url = $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
//echo $hp_index_url;
if ($hp_index_url == "happyjung.com/index.php" || $hp_index_url == "www.happyjung.com/index.php") {
?>
<script type="text/javascript">
<!--
location.href = "http://m.happyjung.com"
//-->
</script>
<?php
}
< 개선된 방법2 : 2016-11-09 추가>
<!doctype html>
<html lang="ko">
를 아래와 같이 변경
<?php
// 브라우저 정보로 홈페이지 이동하기
$ua = $_SERVER['HTTP_USER_AGENT']; // 브라우저 정보
if(preg_match('/(iPhone|Android|Opera Mini|SymbianOS|Windows CE|BlackBerry|Nokia|SonyEricsson|webOS|PalmOS)/i', $ua)) {
if ($hp_index_url == "happyjung.com/index.php" || $hp_index_url == "www.happyjung.com/index.php") {
?>
<script type="text/javascript">
<!--
location.href = "http://m.happyjung.com"
//-->
</script>
<?php
}
}
?>
<!doctype html>
<html lang="ko">
네이버에서 모바일 광고 승인이 거부되었다는 이야기를 듣고 알아보니 http://도메인 으로 모바일 홈페이지가 뜨면 최적화가 안되었다는 거부사유가 뜹니다.
모바일 기기에서 접속할때 http://www.happyjung.com 또는 http://happyjung.com 으로 접속할때 http://m.happyjung.com 으로 넘기는 방법입니다.
이것을 적용하기전에 도메인의 네임서버 설정에서 A 레코드를 추가해야합니다.
A 레코드 추가는 거래하는 웹호스팅사에 문의하세욤.
그누보드5 / 테마 / head.sub.php 의 내용을 이렇게 수정합니다.
< 방법1 >
<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<?php
if (G5_IS_MOBILE) {
를 아래와 같이 변경합니다.
<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<?php
if (G5_IS_MOBILE) {
$hp_index_url = $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
//echo $hp_index_url;
if ($hp_index_url == "happyjung.com/index.php" || $hp_index_url == "www.happyjung.com/index.php") {
?>
<script type="text/javascript">
<!--
location.href = "http://m.happyjung.com"
//-->
</script>
<?php
}
< 개선된 방법2 : 2016-11-09 추가>
<!doctype html>
<html lang="ko">
를 아래와 같이 변경
<?php
// 브라우저 정보로 홈페이지 이동하기
$ua = $_SERVER['HTTP_USER_AGENT']; // 브라우저 정보
if(preg_match('/(iPhone|Android|Opera Mini|SymbianOS|Windows CE|BlackBerry|Nokia|SonyEricsson|webOS|PalmOS)/i', $ua)) {
if ($hp_index_url == "happyjung.com/index.php" || $hp_index_url == "www.happyjung.com/index.php") {
?>
<script type="text/javascript">
<!--
location.href = "http://m.happyjung.com"
//-->
</script>
<?php
}
}
?>
<!doctype html>
<html lang="ko">
댓글 5개
게시글 목록
| 번호 | 제목 |
|---|---|
| 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 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기