Force links to SSL

Permalink
I am running version 5.7.5.3.

I have added a Let's Encrypt serfiticate to our site and added both URL's in the dashboard.

How can I change that all links are by default with https? At the moment if I access the page through https URL it still shows all links for example in Automatic navigation block with http.

Should I do this with .htaccess or is there some configuration where I can change that it would force the site to use https in all links?

Hypocrite
 
Hypocrite replied on at Permalink Reply
Hypocrite
I also noticed that its loading localization files with full URL's instead of relative ones:

<script type="text/javascript" src="/concrete/js/picturefill.js"></script>
<script type="text/javascript" src="/concrete/js/events.js"></script>
<script type="text/javascript" src="/concrete/js/underscore.js"></script>
<script type="text/javascript" src="/concrete/js/backbone.js"></script>
<script type="text/javascript" src="/concrete/js/bootstrap/dropdown.js"></script>
<script type="text/javascript" src="/concrete/js/bootstrap/tooltip.js"></script>
<script type="text/javascript" src="/concrete/js/bootstrap/popover.js"></script>
<script type="text/javascript" src="/concrete/js/jquery-ui.js"></script>
<script type="text/javascript" src="http://www.domain.com/ccm/assets/localization/jquery/ui/js"></script>
<script type="text/javascript" src="http://www.domain.com/ccm/assets/localization/core/js"></script>
Mainio replied on at Permalink Reply
Mainio
I'd personally do it either in .htaccess or even on the level above in the server configs (VirtuaHost block if you're using Apache).

But yes, there is also a setting for that under System & Settings > SEO & Statistics > URLs and Redirection. On that page you'll see "Canonical URLs".
Hypocrite replied on at Permalink Reply
Hypocrite
I was able to get it working by forcing canonical URL to SSL through /application/config/config.php.

'seo' => array(
       'canonical_url'          => 'https://www.domain.com',
         'trailing_slash' => true,
           'url_rewriting_all' => true
    ),
Mainio replied on at Permalink Reply
Mainio
OK, yeah I think that settings page is touching that config too. But of course, if you manually defined that in /application/config/config.php, you're no longer to update it through the UI (if I recall correctly).
Hypocrite replied on at Permalink Reply
Hypocrite
I read from here that it might not work to set https URL to canonical_url through Dashboard:
https://www.concrete5.org/community/forums/5-7-discussion/concrete5....
Mainio replied on at Permalink Reply
Mainio
Seems so based on that.

It also seems it will be "fixed" in v8:
https://github.com/concrete5/concrete5/issues/4016...