0

In M1 it was possible to add some lines to config.xml to force secure urls for certain pages ...

<?xml version="1.0"?>
<config>
    ...
    <frontend>
        ...
        <secure_url>
            <cms_newsletter>/newsletter</cms_newsletter>
            <sendfriend_product>/sendfriend/product</sendfriend_product>
        </secure_url>
    ...

What is the equivalent in Magento2?

1

In Magento2 we can force secure URLs like this

app/code/Vendor/Module/etc/frontend/di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Framework\Url\SecurityInfo">
        <arguments>
            <argument name="secureUrlList" xsi:type="array">
                <item name="checkout_index" xsi:type="string">/checkout</item>
            </argument>
        </arguments>
    </type>
</config>

reference

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.