.htaccess: HTTP -> HTTPS & WWW -> NON-WWW

Submitted by Gast (nicht überprüft) on Mi, 03/28/2018 - 22:18

Beginn von .htaccess:

 RewriteEngine on
 RewriteCond %{HTTPS} off
 RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

 RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
 RewriteRule (.*) https://example.com/$1 [R=301,L]

 

Comments

Gespeichert von Gast (nicht überprüft) am/um Mi, 07/29/2020 - 18:15

Permanenter Link

WWW auf NON-WWW und HTTPS weiterleiten

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

HTTP auf HTTPS weiterleiten

RewriteEngine On

RewriteCond %{HTTPS} off

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

 

Neuen Kommentar schreiben

This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.