Go Back   歡迎來到 xt:Commerce 漢語支援站 > xt:Commerce 技術文件

啟用SSL

From xt:Commerce 技術文件

一定要先編輯 configure.php 檔案後才能在你的商店中啟用 SSL 機制.

在以下列表中有如何調校環境的設定說明

  • includes/

  • includes/admin/

請從網頁伺服器中下載這兩個目錄內的 configure.php 環境設定檔, 並使用文字編輯器來開啟編輯.

在 includes/configure.php 檔案中你可以找到 下述片段 ,你可以依此範例來作修改.

define('HTTPS_SERVER', 'https://localhost'); // eg, https://localhost - should not be empty for productive servers
define('ENABLE_SSL', false); // secure webserver for checkout procedure?

'true'值來取代原先的false值,和使用 https://localhost 取代,並調整成你的 SSL Domain/Proxy 描述。

例如: https://www.Your-Domain.com

Warning 如果你的 SSL 域名無法使用,請與你的虛擬主機供應商聯繫.

範例結果:

define('HTTPS_SERVER', 'https://www.Your-Domain.com'); // eg, https://localhost - should not be empty for productive servers
define('ENABLE_SSL', 'true'); // secure webserver for checkout procedure?

現在你開啟 admin/includs/configure.php 檔案來編輯.

片段:

  define('HTTPS_CATALOG_SERVER', 'https://localhost');
  define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module

就如上述的的例子來作修改.

範例結果:

define('HTTPS_CATALOG_SERVER', 'https://www.Your-Domain.com'); // eg, https://localhost - should not be empty for productive servers
define('ENABLE_SSL_CATALOG', 'true'); // secure webserver for checkout procedure?
Warning 有些虛擬主機還需要在本系統中再作特別的參數調整, 你可以從下列的供應商中找到各式的調校範例

[edit] Hosteurope

開啟並編修 includes/application_top.php

原參數值 (第51行)

$request_type = (getenv('HTTPS') == '1' || getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';

以下述語法來取代

$request_type = ($_SERVER['HTTP_X_FORWARDED_HOST'] == 'ssl.webpack.de') ? 'SSL' : 'NONSSL';

[edit] Domainfactory

  • 編輯 Configure.php 檔案.

檔案: includes/configure.php

define('HTTPS_SERVER', 'https://www.Your-Domain.com'); // eg, https://localhost - should not be empty for productive servers
define('ENABLE_SSL', false); // secure webserver for checkout procedure?

修改為:

define('HTTPS_SERVER', 'https://sslsites.de/Your-Domain.com'); // eg, https://localhost - should not be empty for productive servers
define('ENABLE_SSL', true); // secure webserver for checkout procedure?

檔案: admin/includes/configure.php

define('HTTPS_CATALOG_SERVER', 'https://www.Your-Domain.com');
define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module

修改為:

define('HTTPS_CATALOG_SERVER', 'https://sslsites.de/Your-Domain.com');
define('ENABLE_SSL_CATALOG', 'true'); // secure webserver for catalog module
Warning 請將 "Your-Domain.com" 改正為你的網域名稱
  • 編輯 includes/application_top.php 檔案
$request_type = (getenv('HTTPS') == '1' || getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';

也修改為:

$request_type = ($_SERVER['HTTP_X_FORWARDED_HOST'] == 'sslsites.de') ? 'SSL' : 'NONSSL';
 
   
       
   
www.xt-commerce.cn © 2003 - 2007 xt:Commerce GmbH, all rights reserved
發行事項 | 授权