From 3305df35a7648c90cbba2d0018671b6da492eca1 Mon Sep 17 00:00:00 2001 From: conory Date: Wed, 9 Mar 2016 12:07:44 +0900 Subject: [PATCH 1/2] =?UTF-8?q?SEO=EC=97=90=20=EC=A2=8B=EC=9D=80=20301=20r?= =?UTF-8?q?edirection=20=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/module/ModuleHandler.class.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/classes/module/ModuleHandler.class.php b/classes/module/ModuleHandler.class.php index 0dafb4390..90003a856 100644 --- a/classes/module/ModuleHandler.class.php +++ b/classes/module/ModuleHandler.class.php @@ -96,10 +96,13 @@ class ModuleHandler extends Handler { if(Context::get('_use_ssl') == 'optional' && Context::isExistsSSLAction($this->act) && !RX_SSL) { - if(Context::get('_https_port')!=null) { - header('location:https://' . $_SERVER['HTTP_HOST'] . ':' . Context::get('_https_port') . $_SERVER['REQUEST_URI']); - } else { - header('location:https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); + if(Context::get('_https_port') != null) + { + header('location: https://' . $_SERVER['HTTP_HOST'] . ':' . Context::get('_https_port') . $_SERVER['REQUEST_URI']); + } + else + { + header('location: https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); } return; } @@ -182,7 +185,7 @@ class ModuleHandler extends Handler if(Context::getRequestMethod() == 'GET') { $this->mid = $module_info->mid; - header('location:' . getNotEncodedSiteUrl($site_module_info->domain, 'mid', $this->mid, 'document_srl', $this->document_srl)); + header('location: ' . getNotEncodedSiteUrl($site_module_info->domain, 'mid', $this->mid, 'document_srl', $this->document_srl), true, 301); return FALSE; } else @@ -212,7 +215,7 @@ class ModuleHandler extends Handler if(!$this->module && !$module_info && $site_module_info->site_srl == 0 && $site_module_info->module_site_srl > 0) { $site_info = $oModuleModel->getSiteInfo($site_module_info->module_site_srl); - header("location:" . getNotEncodedSiteUrl($site_info->domain, 'mid', $site_module_info->mid)); + header('location: ' . getNotEncodedSiteUrl($site_info->domain, 'mid', $site_module_info->mid), true, 301); return FALSE; } @@ -241,7 +244,7 @@ class ModuleHandler extends Handler { $redirect_url = getNotEncodedSiteUrl(Context::getDefaultUrl(), 'mid', Context::get('mid'), 'document_srl', Context::get('document_srl'), 'module_srl', Context::get('module_srl'), 'entry', Context::get('entry')); } - header("Location: $redirect_url"); + header("Location: $redirect_url", true, 301); return FALSE; } @@ -884,7 +887,7 @@ class ModuleHandler extends Handler if($_SESSION['XE_VALIDATOR_RETURN_URL']) { - header('location:' . $_SESSION['XE_VALIDATOR_RETURN_URL']); + header('location: ' . $_SESSION['XE_VALIDATOR_RETURN_URL']); return; } From fcf7e258589d9ea4cde9645a3da9a499863654fe Mon Sep 17 00:00:00 2001 From: conory Date: Wed, 9 Mar 2016 13:50:29 +0900 Subject: [PATCH 2/2] =?UTF-8?q?301=20redirection=EC=8B=9C=20=EB=AC=B4?= =?UTF-8?q?=EC=A1=B0=EA=B1=B4=20no-cache=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/module/ModuleHandler.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/classes/module/ModuleHandler.class.php b/classes/module/ModuleHandler.class.php index 90003a856..14ea2e547 100644 --- a/classes/module/ModuleHandler.class.php +++ b/classes/module/ModuleHandler.class.php @@ -184,6 +184,7 @@ class ModuleHandler extends Handler if(Context::getRequestMethod() == 'GET') { + Context::setCacheControl(0); $this->mid = $module_info->mid; header('location: ' . getNotEncodedSiteUrl($site_module_info->domain, 'mid', $this->mid, 'document_srl', $this->document_srl), true, 301); return FALSE; @@ -214,6 +215,7 @@ class ModuleHandler extends Handler // redirect, if module_site_srl and site_srl are different if(!$this->module && !$module_info && $site_module_info->site_srl == 0 && $site_module_info->module_site_srl > 0) { + Context::setCacheControl(0); $site_info = $oModuleModel->getSiteInfo($site_module_info->module_site_srl); header('location: ' . getNotEncodedSiteUrl($site_info->domain, 'mid', $site_module_info->mid), true, 301); return FALSE; @@ -244,6 +246,8 @@ class ModuleHandler extends Handler { $redirect_url = getNotEncodedSiteUrl(Context::getDefaultUrl(), 'mid', Context::get('mid'), 'document_srl', Context::get('document_srl'), 'module_srl', Context::get('module_srl'), 'entry', Context::get('entry')); } + + Context::setCacheControl(0); header("Location: $redirect_url", true, 301); return FALSE; }