News:

Looking for documentation? Take a look on our wiki

Main Menu

Items fail to add to cart in https ssl

Started by Stevejl321, January 26, 2015, 23:13:26 PM

Previous topic - Next topic

jenkinhill

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
Lowestoft, Suffolk, UK

Retired from forum life November 2023

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

rage76

#16
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

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.10.11
php 8.0

jenkinhill

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
Lowestoft, Suffolk, UK

Retired from forum life November 2023

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

rage76

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

Just set the .htaccess as Jenkin has shown you

It should be SSL everywhere thereafter.

At least set this to force https everywhere



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

Joomla 3.10.11
php 8.0

rage76

Dear AH

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

Hope it wont cause any untoward issue.

Warm regards

AH

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.10.11
php 8.0

rage76

Assistance required again for the same issue (automatic redirection from http to https)

mysite.com & http://mysite.com redirect to https://www.mysite.com ---> fine
www.mysite.com or http://www.mysite.com doesn't ---> how to make this happen?


Studio 42

Quote from: rage76 on August 13, 2018, 12:37:14 PM
Assistance required again for the same issue (automatic redirection from http to https)

mysite.com & http://mysite.com redirect to https://www.mysite.com ---> fine
www.mysite.com or http://www.mysite.com doesn't ---> how to make this happen?
# 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]

This redirect any to https://yoursite.com
And dont redirect to WWW, it's completly stupid to use this, if you dont need for technical reason!!!!

rage76

Thanks for a quick response Studio 42.

After going through numerous popular websites, I feel it is better to have www prefixed to the domain, as all of them are still using it; don't you think?

So, as per you I need to use this:

# 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]

How do I change it to include www?

Studio 42

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


Studio 42

Have you this rules at begin of .htaccess?
Try then
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.yoursite.com [NC]
RewriteRule ^(.*)$ https://www.yoursite.com/$1 [L,R=301,NC]