Redirect all HTTP to HTTPS inside PIWIK

I like to force HTTPS all the time.

  1. How to set Piwik Options force_ssl = 1 and force_ssl_login = 1 if there is already installation?
    I do not know If I have configured HTTPS on my Piwik instance. How to verify this option also later?
  2. How to set HTACCESS in the correct way that there is redirected all HTTP to HTTPS?
    I have used SUBdomain like https://myID.example.com
  3. Can I change the tracking code to only send data via HTTPS without interruptions inside app service?

Need help. Is this possible to reply?

Hi there,
isn’t it the following plugin you need to install https://plugins.piwik.org/ForceSsl ?

1 Like

You can modify the settings from the setup in the config/config.ini.php file.

I have put the following line under General section
[Custom settings]
force_ssl = 1
force_ssl_login = 1

When I test only HTTP it will be still shown login page.

How to disable this option as only HTTPS should be forced all the time.
Is this the correct code?

You can write this in your .htaccess file:
RewriteCond %{HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

1 Like

I have tested again. It seems it works HTTPS without added your line.
If I have also SUBdomain like subdomain.maindomain.com/…how to solve this option as your code reports an error:
The page isn’t redirecting properly

Browser has detected that the server is redirecting the request for this address in a way that will never complete.

This problem can sometimes be caused by disabling or refusing to accept cookies.