2

Hi everyone here I am again. I have been looking for the correct https configuration for october so that when visitors type www.mywebsite.com, the brower will assume https:// to be the beginning instead.

I changed the linkPolicy to secure (I tried force too but not sure where is the app.url that it mentioned in the comment) and 'backendForceSecure' to true, it works on when I access www.mywebsite.com/backend (automatically access via https) but not www.mywebsite.com (still access via http). Please help.

warmjaijai
  • 991
  • 4
  • 13
  • 30

3 Answers3

1

This solution worked for me.

1- Enable debug mode:

in config/app.php

'debug' => true,

2- Clear cache

3- Add those lines, in the .htaccess file at the root of your site :

    ## Force secure connection
    RewriteCond %{HTTP:X-Forwarded-Proto} =http [OR]
    RewriteCond %{HTTP:X-Forwarded-Proto} =""
    RewriteCond %{HTTPS} !=on
    RewriteRule ^https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

4- Modifiy the app.url in the /web/config/app.php file

    'app.url' => 'https://...',
Behiry
  • 575
  • 5
  • 20
0

Still no solution for configure https in October CMS? I have nginx shared hosting with Let's encrypt certificate and linkPolicy='secure' still not work properly. How this CMS want to be popular if such a "small" problem can't be fix for 2 years (just check official forum and threads like "Routing over SSL", "Forcing SSL" etc. Using .htaccess is only workaround. F. ex. how to solve this in nginx (without .htaccess)? Buy another server?

Zuba Eman
  • 11
  • 3
  • OctoberCMS is a very good CMS in my opinion but there is still a lot of space to be improved. I am also struggling a lot in looking for answers for some issues but no luck... – warmjaijai Jun 01 '17 at 06:05
  • And I dont think it is proper to ask questions by answering people's questions in Stackoverflow. You can choose to comment on it like what I do now instead. – warmjaijai Jun 01 '17 at 06:09
0

Use .htaccess or configure your apache or ngix to use https and redirect all traffic to https. ngix: https://serverfault.com/questions/67316/in-nginx-how-can-i-rewrite-all-http-requests-to-https-while-maintaining-sub-dom

apache How to redirect all HTTP requests to HTTPS

Use htst headers

Strict-Transport-Security: max-age=31536000

https://www.owasp.org/index.php/HTTP_Strict_Transport_Security_Cheat_Sheet

In path/to/october/config/app.php set your url value to a https domain.

Tschallacka
  • 27,901
  • 14
  • 88
  • 133