cancel
Showing results for 
Search instead for 
Did you mean: 

HTTPS redirects to homepage

SOLVED

HTTPS redirects to homepage

Hello, I want to have all the web in HTTPS, so I put like in the screenshot. The problem is that when I click in a product or other link (organic) in Google redirects to the homepage.

Captura de pantalla 2018-01-10 a las 11.05.59.png

I have this in .htaccess:

 

## enable rewrites

    Options +FollowSymLinks
    RewriteEngine on

RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
5 REPLIES

Re: HTTPS redirects to homepage

Hi @Espamoto,

 

Normally this should be enough:

 

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

Or if you can set the configuration at vhost configuration, something like:

 

RewriteEngine on
RewriteCond %{SERVER_NAME} =www.your-domain.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"

Re: HTTPS redirects to homepage

Thanks, I have tested the first and it´s ok I think.

But when I am in the web I see that the links (categories for example) are in http and then when I click it´s redirected to https.

So, in the UNSECURE part, I have to put the url with HTTPS?
Thanks!

Re: HTTPS redirects to homepage

Yes, You have to keep unsecure url with https in system -> configuration -> web -> base url section.

 

Please let me know if you have any query.

If Issue Solved, Click Kudos/Accept As solutions.

Re: HTTPS redirects to homepage

Hello, I have the problem that the products with http redirects to homepage.

I have this in htaccess:

 

## enable rewrites

    Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Re: HTTPS redirects to homepage

I have now like this and appears to be correct:

 

## enable rewrites

    Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]