I can not in any way test if my address is on https when let's encrypt is installed ...
Could some charitable soul help me redirect to https?
I have installed on my hosting UOLHost (Platform: Linux, Apache: Version 2.4) let's encrypt ... And I do not know if there is any direct relationship (I'm still starting my programming life and I know very little English) between the command:
RewriteCond% {HTTPS} off And the validation let's encrypt ... I believe it should be something related to the type of validation being done by encrypt that prevents the RewriteCond command from checking the host ...
Currently this is my .htaccess
<files ~ "^.*\.([Hh][Tt][Aa])">
order allow,deny
deny from all
satisfy all
</files>
Options -Indexes
Options +FollowSymLinks
ErrorDocument 400 /redirects/400.html
ErrorDocument 401 /redirects/401.html
ErrorDocument 403 /redirects/403.html
ErrorDocument 404 /redirects/404.html
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
#Tentativas RewriteCond %{HTTPS} (FALHA TUDO QUE TENTEI)
RewriteCond %{HTTP_HOST} ^exemplo\.com\.br [NC] #verifica se falta www (MENOR IDEIA DO PQ DO NC)
RewriteRule ^(.*)$ https://www.exemplo.com.br/$1 [R=301,L] #301 Moved Permanently
#Atualmente consegue redirecionar de exemplo.com.br para https://www.exemplo.com.br
</IfModule>
I tried to configure:
RewriteCond %{HTTPS} off [OR] #não funcionou
RewriteCond %{HTTPS} =off [OR] #não funcionou
RewriteCond %{SERVER_PORT} 80 [OR] #não funcionou
RewriteCond %{SERVER_PORT} =80 [OR] #não funcionou
RewriteCond %{HTTP_HOST} ^exemplo\.com\.br [NC]
RewriteRule ^(.*)$ https://www.exemplo.com.br/$1 [R=301,L]
always returns error:
"This page is not working
Excess redirect through www.example.com
Try to clear cookies.
ERR_TOO_MANY_REDIRECTS "
(obs. :) I tested my theory and uninstalled let's encrypt ...
RewriteCond %{HTTPS} =off [OR] #funcionou
RewriteCond %{SERVER_PORT} =80 [OR] #funcionou
The redirection worked but obviously does not solve my problem because I do not have a certificate without the let's encrypt installed.
The problem is in the validation process of let's encrypt ... I need to find another way to redirect, perhaps without using RewriteRule.
Another discussion of the same topic