Zum Inhalt springen

LE htaccess einrichten

Aus Computech CMS Wiki

Let's encrypt

bei der .htaccess folgende Zeilen einfügen. Damit werden alle Anfragen nach HTTPS weitergeleitet.

RewriteEngine On
RewriteCond %{HTTPS} =off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [QSA,L,R=301]



<IfModule mod_rewrite.c>
 RewriteEngine on
 # Take advantage of HSTS if it's available & the request was over https.
 Header always set Strict-Transport-Security "max-age=3456000; includeSubDomains" env=HTTPS
 # Force all traffic to be https & strip 'www.' prefix.
 RewriteCond %{HTTP_HOST} ^www\. [NC,OR]
 RewriteCond %{HTTPS} off
 RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
 RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L]
</IfModule>