Resolved - Rewrite HTTP to HTTPS with Let's Encrypt [duplicate]

0

I have the .htaccess file with the following content:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule ^(.+)$ index.php?path=$1 [QSA,L]

When I load the page, I need to see https: // ...

But only when I click on internal links does the certificate appear.

I do not quite understand these instructions. I know the site uses the MVC framework, so this setting in .htaccess

I also have a config.php, which contains some settings and the following line:

define( 'HOME_URI', 'http://meusite.com/' );

Thanks in advance!

    
asked by anonymous 31.10.2018 / 13:25

1 answer

-2

add the following lines below rewriteEngine ON and below your rewriteCond

RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

getting the code

RewriteEngine On

RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule ^(.+)$ index.php?path=$1 [QSA,L]

This will cause every HTTP request to be redirected to https

    
01.11.2018 / 13:22