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.

<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteCond %{HTTPS} =off
 RewriteRule ^ <nowiki>https://%{HTTP_HOST}%{REQUEST_URI} [QSA,L,R=301]</nowiki>
</IfModule>

Sicher auf Cyon

# Various rewrite rules.
<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>