Pmiguelfpereira
3/24/2017 - 6:20 PM

Forçar o HTTPS e o www num dominio

Forçar o HTTPS e o www num dominio

#.htaccess file
RewriteEngine ON
 
#Força www. no inicio da URL utilizando https ou http
RewriteCond %{HTTP_HOST} ^seudominio\.com
RewriteCond %{HTTPS} =on
RewriteRule .* https://www.%{SERVER_NAME}%{REQUEST_URI} [R,L]
RewriteCond %{HTTP_HOST} ^seudominio\.com
RewriteCond %{HTTPS} !=on
RewriteRule .* http://www.%{SERVER_NAME}%{REQUEST_URI} [R,L]