Author Topic: How to Switch Http to Https?  (Read 564 times)


  • Beginner
  • *
  • Posts: 1
  • A beginner
    • Lajerrio
How to Switch Http to Https?
« on: August 30, 2017, 11:43:49 am »
Hi everyone. Https is a must for every website nowadays.  i have a website, For secure and better for Google. how to switch my site's http to https?
Life has taught us that love does not consist in gazing at each other, but in looking outward together in the same direction.


  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26920
  • Always on vacation
    • Jenkin Hill Internet
Re: How to Switch Http to Https?
« Reply #1 on: August 30, 2017, 12:14:11 pm »
Not really a VirtueMart question, as this should apply to every type of website.

I see that you already have an SSL certificate in place on your server, to install that is normally the first step.
Access your site using https:// and look at the generated code, checking for all occurences of http: links. Where they exist steps should be taken to ensure that https: is used instead, or browsers will issue warnings about mixed/insecure content.
Once that is fixed it is easy to force the site to use SSL. I do this through appropriate .htaccess code, rather than by the settings in Joomla and VM. I also prefer not to use the www. prefix, so if present in a request for the site this is removed.

The .htaccess code I use is:

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


Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VM. on Joomla 3.8.10 PHP 7.0.30

Testing VM. on J3.8.10


  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2768
  • VirtueMart Version: 3.2.15
Re: How to Switch Http to Https?
« Reply #2 on: August 30, 2017, 13:44:24 pm »
Totally agree with Jenkin

Do it in htaccess and ignore using joomla settigns

Here is what I am using

Rewrites everything to https
Then removes the www. - if present

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

## remove www from urls
    RewriteCond %{HTTPS}s on(s)|
    RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    RewriteRule ^ http%2://%1%{REQUEST_URI} [R=301,L]

Joomla 3.8.8
php 7.0