Journal with domain name, OJS 2.4.8

Hi,

I want to have a separate domain name for a journal in a multi-journal installation + eliminate index.php in the URL.

I have a solution, but the last item in the breadcrumbs still goes to a link that contains the shortname of the journal (although I set the base_url of the journal in config.inc.php; e.g. on http://my-journal.org/about/editorialTeam the link “Editorial Team” in the breadcrumbs points to http://my-journal.org/journal1/about/editorialTeam and produces 404)

Does anyone know why the shortname still occurs?

best,
Carola


My settings:

  1. config.inc.php

restful_urls = on
base_url = “http://my-installation.org
base_url[index] = “http://my-installation.org/index
base_url[journal1] = “http://my-journal.org

  1. rewrites for my-installation.org

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [QSA,L]

  1. rewrites for my-journal.org

RewriteRule ^/$ /index
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteRule ^/(.*) /index.php/journal1/$1 [QSA,L]

I had a look at the last/third item of the breadcrumbs (the one with the wrong url), in breadcrumbs.tpl we have:

<a href="{$currentUrl|escape}" class="current">{$pageCrumbTitleTranslated}</a>

$currentUrl is set in class PKPRequest function getRequest Path:

if ($_this->isPathInfoEnabled()) {
   $_this->_requestPath .= isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '';
}

In my example, ($_SERVER['PATH_INFO'] is /journal2/about/history, so this is where the shortname of the journal comes from.

The second item of the breadcrumbs (the one with the correct url) is called differently (breadcrumps.tpl):

<a href="{$hierarchyLink[0]|escape}" class="hierarchyLink">{translate key=$hierarchyLink[1]}</a>

The links are generated with (e.g. in AboutHandler.inc.php):

Request::url(null, 'about')

In my example, this correctly resolves to http://my-journal.org/about

For me it looks like the third item is not generated correctly in cases where the base url is changed. Is there a way around it?

best,
Carola

This sounds familiar, like a bug I have tried to track down in the past. I have multisite rewrite rules including, RewriteRule ^/journalname/(.*)$ /$1 [R], so I’m guessing I never found the source.

Hi @ctgraham,

I also have this line and I assume I got it from your examples here in the forum :slight_smile: , but I commented it out because I thought it should not be necessary …

So now I know it’s the workaround for the url problem.

Yet in the long run it would be better to have the base url in all links.

best,
Carola