Stylesheet (.css) no more accessible when switching to HTTPS & SSL

Hello!

[Edit: I changed the website URL for non-indexing purpose, but let the solution below, that may help next ones].

First of all, thanks to the devs for this amazing tool! I’m using PKP OJS 3.3.0.11 freshly downloaded and installed on an OVH server:

PHP 7.4
SSL Certificate LETSENCRYPT - DV
Database mySQL

I have just tried to switch the website from HTTP to HTTPS (both front & logged it users).
To do so I have followed the steps here: https://docs.pkp.sfu.ca/admin-guide/en/securing-your-system
→ Basically in the “config.inc.php”

  1. add an “s” to “HTTP” line 32: base_url = “https://thejournal.com
  2. turn “On” SSL line 248 force_ssl = On

However, when doing so, the website template sounds to be deactivated (I’m using “Manuscript Default Child Theme”). The website layout becomes like without .css.

I have foraged on the web for a solution & tried different configurations (a lot), notably replacing this process with a .htaccess or editing the index.php instead (e.g. adding // Set https
$_SERVER[‘HTTPS’] = ‘on’;). All the solutions I have tested worked pretty well to switch the website to HTTPS, but none allowed to keep the template (the same issue with all available templates, so it sounds to not be a template issue).

At the moment I have restored the initial configuration to HTTP - so to reproduce the error, it just requires manually rewriting the URL with HTTPS.

I definitely need the website to be safe & SSL…

Any hint?

Thanks,

Rémy

I’m not sure it may help, but when changing http://thejournal.com to → https://thejournal.com, the browser debugging tool indicate:

GET https://thejournal.com/index.php/home/$$$call$$$/page/page/css?name=stylesheet net::ERR_HTTP2_PROTOCOL_ERROR 200

My assumption is that there is an issue with the fact that the journal should be located in the folder (I’ve chosen “home”), the browser manage to find the CSS stylesheet with http but not with https…

Cheers,

Rémy

Hey!

I finally managed to solve this issue :exploding_head: :exploding_head: :exploding_head:

It was probably a problem of double compression (see more info here: https://stackoverflow.com/questions/58215104/whats-the-neterr-http2-protocol-error-about)

What solved it was to add a .htaccess file with

RewriteRule index.php - [E=no-gzip:1]

And that’s it, the website is now https :wink:

Cheers,

Rémy

1 Like

This topic was automatically closed after 14 days. New replies are no longer allowed.