Author Topic: Items fail to add to cart in https ssl  (Read 3045 times)

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26198
  • Always on vacation
    • Jenkin Hill Internet
Re: Items fail to add to cart in https ssl
« Reply #15 on: May 26, 2017, 13:13:08 pm »
I don't make any config settings in Joomla/VirtueMart, I just use .htaccess to force all pages to SSL - I also drop the www. for all sites now.

# match any URL with www and rewrite it to https without the www
RewriteCond %{HTTP_HOST} ^(www\.)(.*) [NC]
RewriteRule (.*) https://%2%{REQUEST_URI} [L,R=301]

# match urls that are non https (without the www)
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^(www\.)(.*) [NC]
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Kelvyn

Jenkin Hill Internet,
Keswick, Lake District

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM3.2.4 on Joomla 3.8 PHP 7.0.23

Testing VM3.2.4 on J!3.8

rage76

  • Jr. Member
  • **
  • Posts: 125
Re: Items fail to add to cart in https ssl
« Reply #16 on: May 26, 2017, 17:54:08 pm »
Thanks GJC & Jenkinhill

This is what I am using in my .htaccess

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysite.com [NC]
RewriteRule ^(.*)$ https://www.mysite.com/$1 [L,R=301,NC]

When I disable SSL in virtuemart, it leads to http page, so some modification is required. Please help me with it.

Also I would like to know any benefits of dropping the "www"?

best wishes

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2584
  • VirtueMart Version: 3.2.4
Re: Items fail to add to cart in https ssl
« Reply #17 on: May 27, 2017, 12:17:01 pm »
Many sites  dont use www any more,  it is often seen as outdated

and it helps in your marketing if you drop it

www.yoursitename.com

vs

yoursitename.com


regards
A

Joomla 3.7.4
php 5.6 + php 7

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26198
  • Always on vacation
    • Jenkin Hill Internet
Re: Items fail to add to cart in https ssl
« Reply #18 on: May 27, 2017, 12:49:46 pm »
In the good old days (1900s) www. was just a domain protocol, just like ftp. telnet. or mail.  Some servers actually required the use of www. as a subdomain for a website.But that is history. There is no need at all for the www. now, and for people typing in a web address it is 4 extra keys to push. Of course there are still people who type http:// in front of the domain as well.................
Kelvyn

Jenkin Hill Internet,
Keswick, Lake District

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM3.2.4 on Joomla 3.8 PHP 7.0.23

Testing VM3.2.4 on J!3.8

rage76

  • Jr. Member
  • **
  • Posts: 125
Re: Items fail to add to cart in https ssl
« Reply #19 on: May 27, 2017, 18:21:24 pm »
When I disable "Enable SSL for sensitive areas" in virtuemart, it leads to http page, so some modification is required.

Please guide me to resolve this issue.

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2584
  • VirtueMart Version: 3.2.4
Re: Items fail to add to cart in https ssl
« Reply #20 on: May 28, 2017, 11:13:32 am »
Just set the .htaccess as Jenkin has shown you

It should be SSL everywhere thereafter.

At least set this to force https everywhere

Code: [Select]

RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
regards
A

Joomla 3.7.4
php 5.6 + php 7

rage76

  • Jr. Member
  • **
  • Posts: 125
Re: Items fail to add to cart in https ssl
« Reply #21 on: May 28, 2017, 16:39:15 pm »
Dear AH

Thank you for the input. Your suggestion seems to be working !!

Hope it wont cause any untoward issue.

Warm regards

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2584
  • VirtueMart Version: 3.2.4
Re: Items fail to add to cart in https ssl
« Reply #22 on: May 28, 2017, 18:48:31 pm »
Thanks for the update

You should be fine - as long as you don't hard code urls in your site with HTTP:// as you will get a mixed content message in the browser
regards
A

Joomla 3.7.4
php 5.6 + php 7