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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

How to force https

Started by Fabrizio Pivari 6 years ago · 4 replies · 901 views
6 years ago

Hello,

to force http to https I've used inside .htaccess

Force non-www:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.nanochimica.it [NC]
RewriteRule ^(.)$ http://nanochimica.it/$1 [L,R=301]
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteCond %{REQUEST_URI} !^/[0-9]+..+.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/.well-known/pki-validation/[A-F0-9]{32}.txt(?:\ Comodo\ DCV)?$
RewriteRule (.
) https://%{HTTP_HOST}%{REQUEST_URI}

The problem is that /index.php doesn't seem to work

I've noticed that also https://nanochimica.it/index.php doesn't work

How can I solve the problem?

fp

6 years ago

Hi! In grav the file "index.php" is not accessible (since a routing system is used).

To force the use of https, you have to edit the following file:
user -> config -> system.yaml
And edit line 6:
force_ssl: true

No extra changes are required in the .htaccess 🙂

👍 1
6 years ago

GREAT!
If I've understood I've to add force_ssl: true in the pages: "area"

fp

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 56 14 hours ago
Support · by Anna, 3 days ago
2 61 17 hours ago
Support · by Justin Young, 18 hours ago
1 32 17 hours ago
Support · by Duc , 1 week ago
2 66 5 days ago
Support · by Colin Hume, 1 week ago
2 59 6 days ago