htaccess is not targeting HTTPS without WWW

Asked

Viewed 41 times

-1

I’m trying to direct the domain to https://com. htaccess but the address typed without using www ex: "meudominio.com.br" is not redirecting, leaving the domain at http:// common, I wonder what’s wrong with this configuration? and how I can force all addresses to direct to "https://"

ErrorDocument 404 /404.php

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

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1
  • Complicated someone came to negative on the question without at least giving a feedback, the same question in gringo stackoverflow had answer and still pointing out possible solutions within the stackoverflow itself

1 answer

0


Browser other questions tagged

You are not signed in. Login or sign up in order to post.