staging.inyokaproject.org

.htaccess HTTP->HTTPS

Status: Ungelöst | Ubuntu-Version: Ubuntu 16.04 (Xenial Xerus)
Antworten |

Derkleinealfred

Anmeldungsdatum:
2. Juli 2015

Beiträge: 262

Hi zusammen,

Ich bin extrem verwirrt in Bezug auf die Weiterleitung von HTTP → HTTPS via .htaccess (ich will es mit .htacces und nicht Apache, da ich da keinen Zugriff drauf habe)

Es gibt soviele Beispiele und soviele Unterschiede, ich will doch einfach nur meine gesammte Seite und Unterseiten auf HTTPS umstellen ☹

Bitte helft mir und dem Internet in Zukunft 😀

1
2
3
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Aus <https://pixelbar.be/blog/htaccess-schnippsel-https-erzwingen/>

1
2
3
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]

Aus <https://wordpress.stackexchange.com/questions/236734/wordpress-redirect-all-http-requests-to-https-via-htaccess>

1
2
3
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Aus <https://stackoverflow.com/questions/32049820/use-htaccess-to-redirect-http-to-https>

1
2
3
RewriteEngine On
RewriteCond %{ENV:HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

Aus <https://stackoverflow.com/questions/32049820/use-htaccess-to-redirect-http-to-https>

1
2
3
RewriteEngine On
rewriteCond %{HTTPS} !on
rewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

Aus <https://stackoverflow.com/questions/3239739/need-to-redirect-all-traffic-to-https>

1
2
3
4
5
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>

Aus <http://www.sysadminslife.com/linux/quicktipp-weiterleitung-redirect-von-http-auf-https-via-apache-oder-htaccess/>

Leubi

Avatar von Leubi

Anmeldungsdatum:
23. April 2017

Beiträge: 36

Moin,

ich habe es bei mir so gelöst,

1
2
3
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443
RewriteRule ^(.*)$ https://www.domaine.de/$1 [r=301,L]

und bin damit sehr zufrieden.

lg Leubi

Antworten |