Magento SSL链接

Rol*_*sen 2 php ssl magento geturl

我已配置magento使用SSL链接..

Base URL      https://sub.domain.com/
Base Link URL {{secure_base_url}}
Base ... URL  {{secure_base_url}}.../

Use Secure URLs in Frontend: YES
Use Secure URLs in Backend:  YES

前端我有一些用Mage :: getUrl([...])构建的自定义链接

<?php
// link to CMS page
echo Mage::getUrl('help'); //-> http://sub.domain.com/help/
// link to customer account
echo Mage::getUrl('customer/account'); //-> httpS://sub.domain.com/customer/account/
?>
Run Code Online (Sandbox Code Playgroud)

为什么协议有区别?

//罗兰

小智 5

我的自定义模块中存在https问题; 我的工作是这样的:

$loadFromSSL = $_SERVER['SERVER_PORT']==443?true:false;

Mage::getUrl('', array('_secure'=>$loadFromSSL))
Run Code Online (Sandbox Code Playgroud)