X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Force HTTPS for all pages (https://forum.x-cart.com/showthread.php?t=73471)

it@igennus.com 01-27-2016 01:16 AM

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;
}
}

totaltec 01-27-2016 04:57 AM

Re: Force HTTPS for all pages
 
Andrew,
Thanks for sharing this simple tip. With your permission I will post it to my X-Cart knowledge base. Would this be acceptable?

-Mike

it@igennus.com 01-27-2016 05:11 AM

Re: Force HTTPS for all pages
 
Sure Mike, with pleasure.

Andrew


All times are GMT -8. The time now is 09:07 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.