Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
    Tweeted twitter.com/#!/StackMagento/status/383703122461597696
3 added 151 characters in body
source | link

I am familiar with using various methods to generate a secure URL based on context, ie:

$this->getUrl('my-page', array('_forced_secure' => $this->getRequest()->isSecure()));

This works great for building links that will direct to a secure page while you are in secure mode (or will just link to the non-secure page if not using secure mode).

The problem I am looking at is Magento only treats a few special pages as needing to be secure (customer account, checkout, etc). What I would prefer would be to have Magento always use a secure link if the user is currently in secure mode, or use the non-secure link if the user is in non-secure mode.

From what I can tell, my only real options are:

  1. Modify every instance of $this->getUrl() to be similar to the snippet above.
  2. Set non-secure base_url to use HTTPS, forcing all pages to secure.

Is there a better method that won't involve having to change every call to $this->getUrl() or forcing all pages to HTTPS regardless of user's context?

-- edit --

I am aware I can modify /app/code/core/Mage/Core/Model/Url.php->setRouteParams() method, though I am hoping there is a cleaner way.

I am familiar with using various methods to generate a secure URL based on context, ie:

$this->getUrl('my-page', array('_forced_secure' => $this->getRequest()->isSecure()));

This works great for building links that will direct to a secure page while you are in secure mode (or will just link to the non-secure page if not using secure mode).

The problem I am looking at is Magento only treats a few special pages as needing to be secure (customer account, checkout, etc). What I would prefer would be to have Magento always use a secure link if the user is currently in secure mode, or use the non-secure link if the user is in non-secure mode.

From what I can tell, my only real options are:

  1. Modify every instance of $this->getUrl() to be similar to the snippet above.
  2. Set non-secure base_url to use HTTPS, forcing all pages to secure.

Is there a better method that won't involve having to change every call to $this->getUrl() or forcing all pages to HTTPS regardless of user's context?

I am familiar with using various methods to generate a secure URL based on context, ie:

$this->getUrl('my-page', array('_forced_secure' => $this->getRequest()->isSecure()));

This works great for building links that will direct to a secure page while you are in secure mode (or will just link to the non-secure page if not using secure mode).

The problem I am looking at is Magento only treats a few special pages as needing to be secure (customer account, checkout, etc). What I would prefer would be to have Magento always use a secure link if the user is currently in secure mode, or use the non-secure link if the user is in non-secure mode.

From what I can tell, my only real options are:

  1. Modify every instance of $this->getUrl() to be similar to the snippet above.
  2. Set non-secure base_url to use HTTPS, forcing all pages to secure.

Is there a better method that won't involve having to change every call to $this->getUrl() or forcing all pages to HTTPS regardless of user's context?

-- edit --

I am aware I can modify /app/code/core/Mage/Core/Model/Url.php->setRouteParams() method, though I am hoping there is a cleaner way.

2 added 29 characters in body
source | link

Using Secure URLs when using HTTPSbased on context

I am familiar with using various methods to generate a secure URL based on context, ie:

$this->getUrl('my-page', array('_forced_secure' => Mage::app()$this->getStore>getRequest()->isCurrentlySecure>isSecure()));

This works great for building links that will direct to a secure page while you are in secure mode (or will just link to the non-secure page if not using secure mode).

The problem I am looking at is Magento only treats a few special pages as needing to be secure (customer account, checkout, etc). What I would prefer would be to have Magento always use a secure link if the user is currently in secure mode, or use the non-secure link if the user is in non-secure mode.

From what I can tell, my only real options are:

  1. Modify every instance of $this->getUrl() to be similar to the snippet above.
  2. Set non-secure base_url to use HTTPS, forcing all pages to secure.

Is there a better method that won't involve having to change every call to $this->getUrl() or forcing all pages to HTTPS regardless of user's context?

Using Secure URLs when using HTTPS

I am familiar with using various methods to generate a secure URL based on context, ie:

$this->getUrl('my-page', array('_forced_secure' => Mage::app()->getStore()->isCurrentlySecure()));

This works great for building links that will direct to a secure page while you are in secure mode (or will just link to the non-secure page if not using secure mode).

The problem I am looking at is Magento only treats a few special pages as needing to be secure (customer account, checkout, etc). What I would prefer would be to have Magento always use a secure link if the user is currently in secure mode, or use the non-secure link if the user is in non-secure mode.

From what I can tell, my only real options are:

  1. Modify every instance of $this->getUrl() to be similar to the snippet above.
  2. Set non-secure base_url to use HTTPS, forcing all pages to secure.

Is there a better method that won't involve having to change every call to $this->getUrl() or forcing all pages to HTTPS?

Using Secure URLs based on context

I am familiar with using various methods to generate a secure URL based on context, ie:

$this->getUrl('my-page', array('_forced_secure' => $this->getRequest()->isSecure()));

This works great for building links that will direct to a secure page while you are in secure mode (or will just link to the non-secure page if not using secure mode).

The problem I am looking at is Magento only treats a few special pages as needing to be secure (customer account, checkout, etc). What I would prefer would be to have Magento always use a secure link if the user is currently in secure mode, or use the non-secure link if the user is in non-secure mode.

From what I can tell, my only real options are:

  1. Modify every instance of $this->getUrl() to be similar to the snippet above.
  2. Set non-secure base_url to use HTTPS, forcing all pages to secure.

Is there a better method that won't involve having to change every call to $this->getUrl() or forcing all pages to HTTPS regardless of user's context?

1
source | link

Using Secure URLs when using HTTPS

I am familiar with using various methods to generate a secure URL based on context, ie:

$this->getUrl('my-page', array('_forced_secure' => Mage::app()->getStore()->isCurrentlySecure()));

This works great for building links that will direct to a secure page while you are in secure mode (or will just link to the non-secure page if not using secure mode).

The problem I am looking at is Magento only treats a few special pages as needing to be secure (customer account, checkout, etc). What I would prefer would be to have Magento always use a secure link if the user is currently in secure mode, or use the non-secure link if the user is in non-secure mode.

From what I can tell, my only real options are:

  1. Modify every instance of $this->getUrl() to be similar to the snippet above.
  2. Set non-secure base_url to use HTTPS, forcing all pages to secure.

Is there a better method that won't involve having to change every call to $this->getUrl() or forcing all pages to HTTPS?