How do I Force HTTPS in Grav CMS?

Grav allows you to force SSL (HTTPS) usage within the configuration file or admin plugin. Note that Grav recommends in a Github thread to use the .htaccess file instead for faster website performance. Below we enable HTTPS using SSH or the admin plugin.

SSH Plugin

Force SSL in CLI

  1. Log into cPanel File Manager or FTP.
  2. Navigate to the /user/config folder.
  3. Open the system.yaml file.
  4. Change force_ssl: false to true.
  5. Save your changes.

Force SSL with Admin Plugin

  1. Force SSL in Grav
    Log into Grav.
  2. Select Configuration.
  3. At the bottom, select Yes beside Force SSL.
  4. Press Save at the top.

Learn more about Grav in our Support Center. Want another option to improve caching in Grav? Optimize your Grav website performance with our WordPress Hosting (not just for WordPress) and Nginx Cache Manager.

Was this article helpful? Let us know!