Multisite OJS with multiple domain - crossed accessible/indexed articles

Hello!

We have a multisite OJS with many journals, but only 3 journals have own domain names.
OJS version: 3.3.0.20

Our problem is that practically all journal articles are accessible from all domains. This is not very convenient, as users can link an article using the URL of a different journal from another domain. However, the issue has escalated to the point where Google has indexed the same article under 2-3 different domains. As a result, an article may appear (based on the URL) as if it was published in a different journal rather than its own.

For example, we have a published article under the correct domain:

https://domain/index.php/journal1/article/view/45778

but we can reach it under other domains too:

https://domain2/index.php/journal1/article/view/45778
https:// domain3/index.php/ journal1/article/view/45778

We also checked the journal’s sitemap (because the indexing problem), but its seemed fine for me. I only found the article URL on that sitemap of the journal, where the article originally was published.

Is there a way to ensure that journal pages are only accessible from their own respective domains?

Thank you in advance for your answer.
Have a nice day.
Best regards, Tiffany Fülöp

Hi everyone,

I really appreciate the help and insights shared in this forum. I posted this question a few weeks ago, but I haven’t received any responses yet. If anyone has a moment to take a look, I’d be very grateful!

Thanks in advance!

Hi @flptiffany ! This is a common problem that one can see in some public OJS instances - e.g., in https://www.sajas.co.za/index.php/ajcr/article/view/17903 the URL contains the domain name of the South African Journal of Animal Science, but the article that you open via the link is actually published in the African Journal on Conflict Resolution (sorry people for using you as an example). I’m surprised it hasn’t been paid more attention, and it’s a shame your post in this forum got overlooked, especially since, as you correctly noted, the wrong links tend to leak into the search engines. The problem is not limited to the particular OJS version.

To solve it, you have to implement some kind of URL redirects in your web server settings (I guess this is the only way) so that the server will enforce the right URLs. Judging by your post, I assume that you don’t use RESTful URLs and let’s pretend your web server is Apache (cuz I dunno anything else, duh).

In the following example, journalsdomain.tld is the main journal portal where the Journal of Common Domain is also hosted, and separatedomain.tld is where you put your Journal of Separate Domain.

Your config.inc.php then contains

base_url = "https://journalsdomain.tld"
...
base_url[jcommond] = "https://journalsdomain.tld/index.php/jcommond"
base_url[jseparated] = "https://separatedomain.tld"

where jcommond and jseparated are the OJS nicknames for the respective journals.

The .htaccess file that you should put into the OJS folder where config.inc.php is may look like

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  
  # this redirects the requests to the main journal portal

  RewriteCond %{HTTP_HOST} !journalsdomain\.tld [NC]
  RewriteCond %{THE_REQUEST} /index\.php/index [NC]
  RewriteRule ^index\.php/index/?(.*)$ https://journalsdomain.tld/index.php/index/$1 [NC,R=301,L]
  
  # this redirects the requests to the Journal of Common Domain

  RewriteCond %{HTTP_HOST} !journalsdomain\.tld [NC]
  RewriteCond %{THE_REQUEST} /index\.php/jcommond [NC]
  RewriteRule ^index\.php/jcommond/?(.*)$ https://journalsdomain.tld/index.php/jcommond/$1 [NC,R=301,L]
  
  # this redirects the requests to the Journal of Separate Domain

  RewriteCond %{HTTP_HOST} !separatedomain\.tld [NC]
  RewriteCond %{THE_REQUEST} /index\.php/jseparated [NC]
  RewriteRule ^index\.php/jseparated/?(.*)$ https://separatedomain.tld/index.php/jseparated/$1 [NC,R=301,L]
  
  # with this I make some of the requests to the Journal of Separate Domain work:
  # if the requested file is not found, the query is redirected

  RewriteCond %{HTTP_HOST} separatedomain\.tld [NC]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ https://separatedomain.tld/index.php/jseparated/$1 [NC,R=301,L]
</IfModule>

where RewriteConditions are like “if the hostname is not what it should be for this particular index.php/journal part of the URL, redirect the request to the right hostname”.

I quickly tested this example on my test installation and after clickity-clicking through the website and the admin/dashboard pages it didn’t give me any trouble (aside from the strange issue I mention here which, I think, is not due to the web server settings). However, I can’t say that this has been thoroughly tested, I’m no expert in Apache configs, and these rewrite rules may conflict with what you have in place (you may not even use Apache after all) so, as usual, no guarantee this will work. I hope, however, that this will give you or someone some food for thought.