Let's see if any partner takes me out of doubt.
I'm about to launch a new website designed with php and I want to modify the .htaccess file to use the SSL security certificate.
I have found so many examples that I do not know how to use . Someone would be so kind and I could explain if it is possible in detail what each line of the codes I show below means or what each one is for.
Example 1: This uses (IfModule) .
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} off
RewriteRule (.*) https://www.example.com/$1 [R=301,L,QSA]
</IfModule>
Example 2:
# Enviar trafico HTTP a HTTPS
RewriteEngine On
RewriteCond %{ENV:HTTPS} !on [NC]
RewriteCond %{HTTP_HOST} ^tu_dominio\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.tu_dominio\.com$
RewriteRule ^(.*)$ https://tudominio.com/$1 [R=301,L,NE]
And in some cases they recommend adding the following lines, which are not used either:
SSLOptions + StrictRequire
SSLRequireSSL
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
The one who can answer my questions will be very grateful to you.
Thank you very much for your time.
Greetings.