質問

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/
?>

プロトコルに違いがあるのはなぜですか?

//ローランド

役に立ちましたか?

解決

app / code / core / Mage / Customer / etc / config.xml には、 / customer frontend / secure_url のエントリがあります。

これは役立ちます

他のヒント

カスタムモジュールでhttpsに問題がありました。私の回避策は次のとおりでした:

$loadFromSSL = 

カスタムモジュールでhttpsに問題がありました。私の回避策は次のとおりでした:

<*>SERVER['SERVER_PORT']==443?true:false; Mage::getUrl('', array('_secure'=>$loadFromSSL))

これはもっと良いと思う (から: http://thecompleteprogramer.wordpress.com/2012/09/11/magento-get-url-with-or-without-secure-path-according-to-current-url-protocol/

Mage::getUrl('yourpath', array('_secure' => Mage::app()->getFrontController()->getRequest()->isSecure()));

これでうまくいきました

echo Mage::getUrl('customer/account/loginPost',array('_secure'=>true));

例:

http でブラウジングした場合

echo Mage::getUrl('customer/account/loginPost',array('_secure'=>true));
// http://dominio.com/customer/account/loginPost

https でブラウジングしている場合

echo Mage::getUrl('customer/account/loginPost',array('_secure'=>true));
// https://dominio.com/customer/account/loginPost
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top