HTTPS REDIRECT

created: 23.10.2018 14:17

edited: 30.10.2018 08:49

back

change: /webroot/.htaccess
line 251 - 274

http
<IfModule mod_rewrite.c>
    RewriteCond %{HTTPS} !=on
    RewriteCond %{HTTP_HOST} !^www\. [NC]
    # Localhost ausnehmen
    RewriteCond %{SERVER_ADDR} !=127.0.0.1
    RewriteCond %{SERVER_ADDR} !=::1
    # Entwicklungsserver 55.*.mh ausnehmen
    RewriteCond %{SERVER_ADDR} !=192.168.0.13
    RewriteCond %{ENV:APP_ENVIRONMENT} !=dev
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [L,R=301]

    RewriteCond %{HTTPS} =on
    RewriteCond %{HTTP_HOST} !^www\. [NC]
    # Localhost ausnehmen
    RewriteCond %{SERVER_ADDR} !=127.0.0.1
    RewriteCond %{SERVER_ADDR} !=::1
    # Entwicklungsserver 55.*.mh ausnehmen
    RewriteCond %{SERVER_ADDR} !=192.168.0.13
    RewriteCond %{ENV:APP_ENVIRONMENT} !=dev
    RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [L,R=301]
</IfModule>