Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Force SSL

Started by Muut Archive 10 years ago · 3 replies · 843 views
10 years ago

I think I'm missing some function to force the site to be only displayed via https.
I tried it with the common rewrite rule, but it does not work:

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

Any tipps?

10 years ago

there is some incompatibility with my rule to force https and this default .htaccess Rule:
RewriteRule .* index.php [L]

Any way to redirect all non https traffic to https and still redirect all to the index.php?

10 years ago
TXT
RewriteEngine On

RewriteCond %{HTTP:X-Forwarded-Proto} !=https
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=302,L]

This is what I use on getgrav.org

👍 1

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1354 9 years ago
Archive · by Muut Archive, 9 years ago
2 935 9 years ago
Archive · by Muut Archive, 9 years ago
2 4065 9 years ago
Archive · by Muut Archive, 9 years ago
1 2953 9 years ago
Archive · by Muut Archive, 9 years ago
3 1119 9 years ago