carola
February 20, 2017, 3:47pm
1
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:
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 ”
rewrites for my-installation.org
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [QSA,L]
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]
carola
March 1, 2017, 5:28pm
2
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.
carola
March 8, 2017, 9:27am
4
Hi @ctgraham ,
I also have this line and I assume I got it from your examples here in the forum , 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