Advertisement:

Author Topic: HTTP to HTTPS how to do?  (Read 2102 times)

Chastomber

  • Newbie
  • *
  • Posts: 13
HTTP to HTTPS how to do?
« on: January 30, 2018, 04:51:14 pm »
Hello,
I need to redirect Http to Https... If I change .htacess with the code below, can I?

# Redirecionar para HTTPS WC
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: HTTP to HTTPS how to do?
« Reply #1 on: January 30, 2018, 05:27:11 pm »
edit config.php with https instead of http

Chastomber

  • Newbie
  • *
  • Posts: 13
Re: HTTP to HTTPS how to do?
« Reply #2 on: January 30, 2018, 05:43:48 pm »

Thanks ... it works, but now it looks like I have 2 sites.
If I type www.encontreaqui.online - https does not show ... I need to write https.incontact.online ... I would like to redirect automatically ... I need to use .htaccess OR can I make a code in config.php to redirect

tito

  • issues
  • Sr. Member
  • *
  • Posts: 397
Re: HTTP to HTTPS how to do?
« Reply #3 on: January 30, 2018, 07:46:58 pm »
Use this htaccess:

Code: [Select]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Aficionado

  • Guest
Re: HTTP to HTTPS how to do?
« Reply #4 on: January 31, 2018, 03:42:04 pm »
Code: [Select]
#SSL START

RewriteEngine On

RewriteCond %{SERVER_PORT} 80

RewriteRule ^(.*)$ https://www.website.com/$1 [R=301,L]

#SSL END

mrtsoftware

  • Sr. Member
  • ****
  • Posts: 343
Re: HTTP to HTTPS how to do?
« Reply #5 on: January 31, 2018, 03:44:55 pm »
You need to also active SEO ( permalinks ) URL

windson

  • Newbie
  • *
  • Posts: 22
Re: HTTP to HTTPS how to do?
« Reply #6 on: June 20, 2019, 09:18:05 pm »
This should be as per the order of lines mentioned below.

Code: [Select]
<IfModule mod_rewrite.c>
RewriteEngine On

# start ensure https
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# end ensure https

RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]


</IfModule>