Page 1 of 1

Problema al activar https en .htaccess

Posted: Tue Mar 12, 2019 2:19 am
by hostbridge
Buenas tardes a todos, tengo un problema, he contratado el certificado ssl, y lo he activado en cpanel, en el ftp he modificado el config del admin y el config del root y ademas he activado ssl en editar ajustes / servidor dentro del admin, el problema lo tengo al modificar el htaccess simplemente es incluirle la "s" al http de forma que queda https y la web deja de funcionar en algunas subcategorias, es muy curioso carga la web pero sin formato, vuelvo a poner Http en el .htaccess y funciona todo con normalidad pero se queda en http://www y claro no redirige a https://www, algun veterano puede echarme un cable?

Gracias.

Re: Problema al activar https en .htaccess

Posted: Tue Mar 12, 2019 7:57 am
by IP_CAM

Code: Select all

<IfModule mod_rewrite.c>
# Redirect all traffic to https://www
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [NE,L,R=301]
</IfModule>

<IfModule mod_rewrite.c>
# Redirect all traffic to https://www
RewriteEngine on
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule (.*) https://www.example.com%{REQUEST_URI} [NE,L,R=301]
</IfModule>

<IfModule mod_rewrite.c>
# Redirect all traffic to https:// non www
RewriteEngine on
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule (.*) https://example.com%{REQUEST_URI} [R=301,L]
</IfModule>

<IfModule mod_rewrite.c>
# Redirect all traffic to https:// subdomain
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://app.example.com%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L]
</IfModule>

<IfModule mod_rewrite.c>
# Cloudflare
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

Re: Problema al activar https en .htaccess

Posted: Tue Mar 12, 2019 4:16 pm
by hostbridge
This code is the .htaccess?

Re: Problema al activar https en .htaccess

Posted: Tue Mar 12, 2019 9:54 pm
by IP_CAM
Yes, insert, what you need of it.
Ernie

Re: Problema al activar https en .htaccess

Posted: Wed Mar 13, 2019 2:03 am
by hostbridge
Me he dado cuenta de que el problema viene cuando activo Usar SEO URLs dentro del admin en tienda/servidor, en cuanto lo activo deja de funcionarme algunas categorias se ven sin formato sale el texto solamente, muy raro....

Re: Problema al activar https en .htaccess

Posted: Thu Mar 14, 2019 4:44 pm
by hostbridge
inserting R = 301 in this line has worked, I hope you solve someone else's problem, thanks for the answers.
being that way->

RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA,R=301]