Forzar HTTPS

Aqui veremos distintas maneras de forzar HTTPS, a través de la modificación del archivo .htaccess, recomendamos usar la primera versión, pero para distintas preferencias dejaremos varias opciones.

# Forzar HTTPS por PremiumHosting
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# Forzar HTTPS por PremiumHosting
# Forzar HTTPS y WWW por PremiumHosting
RewriteEngine on
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$
RewriteRule ^ https://www.%1%{REQUEST_URI} [NE,L,R=301]
# Forzar HTTPS y WWW por PremiumHosting
# Forzar HTTPS y NO-WWWpor PremiumHosting
RewriteEngine on
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$
RewriteRule ^ https://%1%{REQUEST_URI} [NE,L,R=301]
# Forzar HTTPS y NO-WWW por PremiumHosting

Siempre puedes pedirnos ayuda para configurar tu sitio con HTTPS!

Updated on 13 marzo, 2024

Was this article helpful?

Related Articles

Leave a Comment