We officially migrated all our journals to OJS31, to OJS 3.1.0-1 exactly.
Until now it was just in test.
We encounter some problem to display content of a journal with its own domain (using RewriteRule in .htacess) in https because of stylesheet links generated in http. We didn’t encounter this problem with OJS2.
All our journals have their own domain. So we have an “.htacess” file with RewriteRule directives like this:
RewriteEngine On
RewriteCond %{SERVER_NAME} ^(www.)?journal1.org
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php/journal1/$1 [QSA,L]
And here is an example of our “config.inc.php” file:
base_url = “http://journalsportal.org/journals”
disable_path_info = Off
allow_url_fopen = Off
base_url[journal1] = http://journal1.org
restful_urls = Off
trust_x_forwarded_for = On
force_ssl = Off
force_login_ssl = On
session_check_ip = On
And here is a part of our Apache (2.4) config file for http:
<VirtualHost *:80>
ServerName journal1.org
DocumentRoot /var/www/journals<Directory /var/www/journals>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
And here is a part of our Apache (2.4) config file for https:
ServerName journal1.org DocumentRoot /var/www/journals<Directory /var/www/journals>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
Each journal have their onw custom theme.
When we access the journal in “http” (http://journal1.org), all works fine. But when we access the journal in “https” (https://journal1.org), all the links of stylesheet theme are in “http” instead of “https” and the web browser blocks the content because of “mixed active content”. For example:
link rel=“stylesheet” href=“http://journal1.org/$$$call$$$/page/page/css?name=stylesheet” type=“text/css”
But it doesn’t happen for the portal web site. Links of stylesheet theme are well in “https”. For example:
link rel=“stylesheet” href=“https://journalsportal.org/journals/index.php/index/$$$call$$$/page/page/css?name=stylesheet” type=“text/css”
I did some tests. When in “config.inc.php” file, I change this line:
base_url[journal1] = https://journal1.org
All the content, is well displayed in https but we don’t want a base_url in https.
I did some research and I put some “error_log” in some files to display variables values in logs to see where url is generated.
In “_registerStyles” function in “/lib/pkp/classes/plugins/ThemePlugin.inc.php” file, url are called via “$dispatcher->url” function with this line:
$styles = $dispatcher->url($request,ROUTE_COMPONENT,null,‘page.PageHandler’,‘css’,null,array(‘name’ => $name,));
In “_urlGetBaseAndContext” function in “/lib/pkp/classes/core/PKPRouter.inc.php” file, url are generated.
I don’t know exactly how all php code work in this function but when I keep only this line:
$baseUrl = $this->getIndexUrl($request);
My stylesheets links are well generates in https. But they are of course other problems of links that are not well overridden.
My question is:
Is it a problem of OJS31 which doesn’t manage well all cases of “baseUrl” generation ?
OR
Is it a problem of my particular configuration and setting that I have to change ?
Thanks in advance for your help.
Best regards
Helene