$pre_path = \amg\UrlTool::toPath($route); $pre_glue = substr($pre_path,-1) == '/' ? '' : '/'; $redirect = $pre_path.$pre_glue.urlencode($filename).($page > 1 ? '-page-'.$page : '').'.'.$ext; //PS: 第 1 頁省略 "-page-1" header('HTTP/1.1 301 Moved Permanently'); header('Location: '.$redirect); exit; //# } //(301) 有 SEO 時,存取 /foo/id1/show/id2 發現有 seo-filename1 與 seo-filename2 則 301 到 /foo/filename1/filename2.htm protected static function checkSeoFilesRedirect301($route, array $xc_row, array $x_row, $ext = \Amg::SEO_FILE_EXT) { if(! parent::isSeoModuleEnable()) return; //do-nothing $cate_file = \ModelUtils::detectSeoFilename($xc_row); $data_file = \ModelUtils::detectSeoFilename($x_row); if(empty($cate_file) || empty($data_file)) return; //do-nothing $pre_path = \amg\UrlTool::toPath($route); $pre_glue = substr($pre_path,-1) == '/' ? '' : '/'; $redirect = $pre_path.$pre_glue.urlencode($cate_file).'/'.urlencode($data_file).'.'.$ext; header('HTTP/1.1 301 Moved Permanently');
$nc_key = \News2bCateModel::getIdColumn(); $n_row = \News2bModel::fetchIdRow($n_id); if(empty($n_row)) parent::exit404(); //# if($n_row[$nc_key] != $nc_id) parent::exit400(); //# $nc_rows = self::getCateRows(); $nc_row = \ModelUtils::getFilterRow($nc_rows, [$nc_key=>$nc_id]); parent::checkSeoFilesRedirect301($this->id, $nc_row, $n_row); //# return $this->doDataShow($n_row, $nc_rows); } //------------------------------------------------------------------------
$args = $this->controller->bindActionParams($this, $params); Yii::debug('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__); if (Yii::$app->requestedParams === null) { Yii::$app->requestedParams = $args; } return call_user_func_array([$this->controller, $this->actionMethod], $args); } }
} $result = null; if ($runAction && $this->beforeAction($action)) { // run the action $result = $action->runWithParams($params); $result = $this->afterAction($action, $result); // call afterAction on modules foreach ($modules as $module) { /* @var $module Module */
$parts = $this->createController($route); if (is_array($parts)) { /* @var $controller Controller */ list($controller, $actionID) = $parts; $oldController = Yii::$app->controller; Yii::$app->controller = $controller; $result = $controller->runAction($actionID, $params); if ($oldController !== null) { Yii::$app->controller = $oldController; } return $result; }
$params = $this->catchAll; unset($params[0]); } try { Yii::debug("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } $response = $this->getResponse(); if ($result !== null) {
{ try { $this->state = self::STATE_BEFORE_REQUEST; $this->trigger(self::EVENT_BEFORE_REQUEST); $this->state = self::STATE_HANDLING_REQUEST; $response = $this->handleRequest($this->getRequest()); $this->state = self::STATE_AFTER_REQUEST; $this->trigger(self::EVENT_AFTER_REQUEST); $this->state = self::STATE_SENDING_RESPONSE; $response->send();
require __DIR__ . '/../frontend/config/main.php', require __DIR__ . '/../frontend/config/main-local.php' ); //---------------------------------------------------------------------------- (new \amg\AmgApplication($configs,false))->run(); //is-a \yii\web\Application
$_GET = [ 'id1' => '7', 'id2' => '42', ]; $_SESSION = [ '__flash' => [], 'bossmallcht' => [ 'sc_id' => 1, 'sc_status' => 1, 'sc_close_msg' => '', 'sc_front_theme' => 0, 'sc_default_front_page' => 'main.php', 'sc_company' => '社團法人臺中市大大人長期照護關懷協會', 'sc_cart_type' => 1, 'sc_shipping_price' => 100, 'sc_no_shipping_price' => 3000, 'sc_sort_type' => 1, 'sc_ad_sort_type' => 0, 'sc_email' => '[email protected],[email protected]', 'sc_debug' => 1, 'sc_template' => 1, 'sc_one_page_limit' => 12, 'sc_session_duration' => 14400, 'sc_meta_title' => '台中居家照護 | 長照補助 | 長照諮詢 | 社團法人臺中市大大人長期照護關懷協會', 'sc_meta_keyword' => '長照2.0 , 老人照顧, 長照諮詢, 居家照護, 日間照顧機構, 長照積分課程, 照服訓, 台中長照單位, 台中居家照護, 台中日間照顧機構, 台中日照中心, 神岡日照, 潭子日照', 'sc_meta_description' => '在臺中市神岡區創立了「大大人奉茶館」,是本人落實社會福利企業的平台, 這是長照2.0社區整體照顧服務的實體A級「長照旗艦店」,在優美的空間, 奉茶關懷的環境中,提供一案到底一條龍的陪伴服務,從長照諮詢與申請、 到府評估與個別化計畫擬定,與居家服務、喘息服務、輔具、無障礙設施設備、 復健等服務資源連結,以及後續服務的追蹤評核等,提供溫暖且專業的完整長照服務平台。', 'sc_meta_verifications' => '{"google":"KT_0Ppnqxr6qOiBVjzFn4ifgsGHHuetO9n0Raq1JDDY"}', 'sc_meta_company' => '頤和園大大人長期照護', 'sc_meta_logo' => 'https://www.dadazen.com.tw/images/logo.svg', 'sc_short_desc' => null, 'sc_seo_h1' => null, 'sc_home_video' => 'https://www.youtube.com/watch?v=F5mEQx71AJs', 'sc_rss_feeds' => null, 'sc_im_status' => 0, 'sc_im_starttime' => '00:00:00', 'sc_im_endtime' => '00:00:00', 'sc_im_msn' => '', 'sc_im_skype' => '', 'sc_seo_rewrite' => 0, 'sc_desc_title_default' => '', 'sc_character_title_default' => '', 'sc_spec_title_default' => '', 'sc_ga_code' => 'UA-155025364-48', 'sc_gtm_cid' => '', 'sc_fb_pixel' => null, 'sc_fb_chat' => null, 'sc_logistic_SenderName' => '大大人長期照護關懷協會', 'sc_logistic_SenderPhone' => '', 'sc_logistic_SenderCellPhone' => '', 'sc_logistic_SenderZipCode' => '', 'sc_logistic_SenderAddress' => '', 'sc_credit_installment3' => 1000, 'sc_credit_installment6' => 2000, 'sc_credit_installment12' => 3000, 'sc_credit_installment18' => 4000, 'sc_credit_installment24' => 5000, 'sc_credit_rate3' => 0, 'sc_credit_rate6' => 0, 'sc_credit_rate12' => 0, 'sc_credit_rate18' => 0, 'sc_credit_rate24' => 0, 'cart_items' => [], 'clow_items' => [], 'cart_info' => null, ], ];