Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Do You Get The Store Secure URL in Magento?

Tags:

forms

magento

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?

like image 270
Josh Pennington Avatar asked Nov 23 '10 14:11

Josh Pennington


People also ask

How do I add store codes to URLs in Magento 2?

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.

What is the store URL?

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.

How do I get the base URL in Magento 2 cms block?

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.


1 Answers

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

like image 174
shaune Avatar answered Nov 07 '22 09:11

shaune