0

I am trying to program a redirect from http to https and also delete the www. It already does, my problem is that if you write: http://www.dominio.com/something/ should change to https://dominio.com/something/ and does not work, does not detect anything after .com anyone me help?

RewriteEngine On 
RewriteCond% {HTTPS} off 
RewriteCond% {HTTP_HOST} ^ www.midominio.com 
RewriteRule ^ (. *) $ Https://midominio.com/$1 [R = 301, L] 

RewriteCond% {HTTPS}! = On 
RewriteRule ^ / (. *) Https:% {SERVER_NAME} // / $ 1 [R = 301, L]

1 Answers1

0

Think this question has been answered before here: http to https through .htaccess and here .htaccess redirect both http:// with and without www and https://www to https:// non-www

RewriteEngine On
 RewriteCond %{HTTPS} !=on
 RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
Community
  • 1
  • 1
just some guy
  • 524
  • 1
  • 4
  • 18
  • Thanks, but doesn't work, in the others themes not exist the answer RewriteEngine On RewriteCond% {HTTPS} off RewriteCond% {HTTP_HOST} ^ www.midominio.com RewriteRule ^ (. *) $ Https://midominio.com/$1 [R = 301, L] RewriteCond %{HTTPS} !=on RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L] – Pepito Rosales Oct 22 '14 at 17:58