Force HTTPS for all pages
X-cart 5 has a feature that can enable HTTPS for the store backend, checkout, sign-in and profile pages - assuming you have a valid SSL certificate. Many sites are moving to HTTPS everywhere for very good reasons. The performance hit is not so much of an issue now if you can employ HTTP/2 or SPDY.
Perhaps X-cart should consider this as a configurable option for a later release.
Setting up Apache or Nginx rewrite rules can achieve this.
But as an alternative, if anyone finds this useful, I created a tiny module with just one file in addition to main.php. NB. replace <modowner>, <modname> as you wish..
.../<modowner>/<modname>/Controller/AController.php
<?php
// vim: set ts=4 sw=4 sts=4 et:
/**
* Force HTTPS everywhere
*
*/
namespace XLite\Module\<modowner>\<modname>\Controller;
class AController extends \XLite\Controller\AController implements \XLite\Base\IDecorator
{
/**
* force https
*
* @return boolean
*/
public function isSecure()
{
return true;
}
}
__________________
4.6.1
5.2.10
Andrew
|