Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Force HTTPS for all pages

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 01-27-2016, 01:16 AM
 
it@igennus.com it@igennus.com is offline
 

Newbie
  
Join Date: Sep 2013
Posts: 9
 

Default 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
Reply With Quote

The following user thanks it@igennus.com for this useful post:
totaltec (01-27-2016)
  #2  
Old 01-27-2016, 04:57 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default 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
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #3  
Old 01-27-2016, 05:11 AM
 
it@igennus.com it@igennus.com is offline
 

Newbie
  
Join Date: Sep 2013
Posts: 9
 

Default Re: Force HTTPS for all pages

Sure Mike, with pleasure.

Andrew
__________________
4.6.1
5.2.10
Andrew
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:32 AM.

   

 
X-Cart forums © 2001-2020