作者 zhl

'u'

@@ -69,7 +69,30 @@ public function createBtSite($domain, $ssl_open, $ssl_auto, $ssl_auto_day, $ssl_ @@ -69,7 +69,30 @@ public function createBtSite($domain, $ssl_open, $ssl_auto, $ssl_auto_day, $ssl_
69 if (empty($result) || empty($result['siteId'])) 69 if (empty($result) || empty($result['siteId']))
70 return false; 70 return false;
71 // 伪静态设置 71 // 伪静态设置
72 - // $bt->SaveFileBody($host, ''); 72 + $htaccess = '# SEO URL Settings
  73 + # Nginx configuration of OC htaccess
  74 + location = /sitemap.xml {
  75 + rewrite ^(.*)$ /index.php?route=feed/google_sitemap break;
  76 + }
  77 +
  78 + location = /googlebase.xml {
  79 + rewrite ^(.*)$ /index.php?route=feed/google_base break;
  80 + }
  81 +
  82 + location / {
  83 + # This try_files directive is used to enable SEO-friendly URLs for OpenCart
  84 + try_files $uri $uri/ @opencart;
  85 + # 隐藏index.php
  86 + if (!-e $request_filename) {
  87 + rewrite ^/(.*)$ /index.php?$1 last;
  88 + }
  89 + }
  90 +
  91 + location @opencart {
  92 + rewrite ^/(.+)$ /index.php?_route_=$1 last;
  93 + }
  94 + # End SEO settings';
  95 + $bt->SaveFileBody($host, $htaccess);
73 96
74 $result = BtSites::createBtSite($host, $result['siteId'], $ssl_open, $ssl_status, $ssl_auto, $ssl_auto_day); 97 $result = BtSites::createBtSite($host, $result['siteId'], $ssl_open, $ssl_status, $ssl_auto, $ssl_auto_day);
75 $site = $result->toArray(); 98 $site = $result->toArray();