I have a form in Magento that is displayed over the insecure URL (http) but I need it to submit to the secure URL (https).
I display the URL I currently use the following code:
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB)
I am assuming I need to change the URL_TYPE_WEB to something else. Does anyone know what that something else is?
Navigate to Stores > Configuration > General > Web and find the Url Options section. There you choose to Add Store Code to URLs selecting Yes from the corresponding select box and Save Config.
Your store's online address, or URL, is what appears in your customer's browser address bar when they visit your site. If you have a custom domain, it will be something like my-store.com.
Step-1: Create a page through CMS>Pages. In 'Page Information' Tab section we set URL Key* page-contact-us Necessary Text can be written through the content tab area. That's all, the Base URL of that Static-block is now activated and can be retrieved dynamically.
Have you tried this?
Mage::getUrl('',array('_secure'=>true))
I think that gets you the base secure url, I believe.
Mage::getUrl('customer/account/login',array('_secure'=>true))
Will get you to the login page. In other words,
Mage::getUrl('module/controller/action',array('_secure'=>true))
Will get you to any page you want, just substitute 'module/controller/action' for the appropriate combo.
Edit -- Fixed Typos
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With