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.
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]
Solved! Go to Solution.
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.
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]
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!
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.
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]
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]
Your .htaccess Code does not work for me, I get ERR_TOO_MANY_REDIRECTS
If your getting too many redirects you can try using this one:
#enable rewrites
Options +FollowSymLinks
RewriteEngine on
# Rewrite any request to use www.
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Rewrite to HTTPS:
RewriteCond %{HTTPS} off
# Don't put www. here the ABOVE rule will catch it.
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]