Permanente Umleitung auf https://www per htaccess (klappt auch bei Strato)


RewriteEngine on
# If your CMSMS installation is in a subdirectory of your domain, you need to specify the relative path (from the root of the domain) here.
# In example: RewriteBase /[subdirectory name]
RewriteBase /

# +++++ ADD THIS - START +++++
# Link to http(s):// then redirect to
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

# Force URLs have https instead of http
# RewriteCond %{HTTPS} off
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# ++++++ ADD THIS - END +++++