Osclass forums

Support forums => Installation / Update help => Topic started by: Chastomber on January 30, 2018, 04:51:14 pm

Title: HTTP to HTTPS how to do?
Post by: Chastomber 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]
Title: Re: HTTP to HTTPS how to do?
Post by: marius-ciclistu on January 30, 2018, 05:27:11 pm
edit config.php with https instead of http
Title: Re: HTTP to HTTPS how to do?
Post by: Chastomber 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
Title: Re: HTTP to HTTPS how to do?
Post by: tito 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>
Title: Re: HTTP to HTTPS how to do?
Post by: Aficionado 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
Title: Re: HTTP to HTTPS how to do?
Post by: mrtsoftware on January 31, 2018, 03:44:55 pm
You need to also active SEO ( permalinks ) URL
Title: Re: HTTP to HTTPS how to do?
Post by: windson 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>