Regarding the user home, this is a longstanding difference of opinion within the project regarding whether the user home should direct to the Site, or whether the user home should direct to the current Journal. See: https://pkp.sfu.ca/bugzilla/bugslist/show_bug.cgi?id=8802
The current 2.4.8 code tries to detect whether the user has access to multiple journals within the site, and send the user to the Site if that is the case:
I have preferred to always default to the Journalâs User Home:
Thanks very much. I agree it should default to the journal userâs home, not the OJS installation.
Iâm not clear what to do with the extra rule, though. I should have made it clear that this server is serving dozens of applications, not just OJS, and right now, this journal is the only cname using Rewrite, so all the rules are inside the Apache VH block for that cname.
To my mind, as the problem arises with http://SERVER.ucc.ie/ojs/user, not http://JNAME.ucc.ie/ojs/user, I would need to add this rule at the top level of httpd.conf, outside any virtual host blocks, and it could then be hardwired to catch this specific instanceâŠwhich of course wonât work when there are multiple journals, because how will it know which one to go to when there is no trace of a journal name in the incoming URI?
Iâm tearing my hair out here in frustration. Thanks for your tips on getting a custom-subdomain-per-journal working, that seems to be fine. What is not fine is that no-one else can login, only users of the subdomain-named journal. Users who want to log in at plain /ojs/ get a 404 when they click Login
Demo: If you go to http://sulis.ucc.ie/ojs/ and try to log in as user foo with password bar, you get a 404 The requested URL /ojs/login/signIn was not found on this server.
Can anyone suggest why? Where is that click on Login supposed to go to?
In the URL /ojs/login/signIn, /ojs would be your OJS root location which contain index.php. Youâll need a rewrite rule that maps âlogin/signInâ following âindex.php/index/â. The second âindexâ reference there is for the site index, which would otherwise be the journal shortname.
Thanks for your swift response.
This is plain CentOS6 with plain Apache2. Lots of other virtual hosts, but OJS is in /var/www/html/ojs.
Iâm not clear what âfollowingâ means in your suggestion. Do you mean
RewriteRule index.php/index/ login/signIn
or are you implying that I should already have some other rule mentioning index.php/index and that a new one is to come on the line underneath? If so, what would the exact incantation be?
The only two lines in the config right now are these (and I only added them yesterday, from a suggestion I found on one of the web pages about rewrite problems in OJS, while trying to fix this).
The oddity is that itâs been working fine for a year, with users logging in without problems. No-one has updated anything (they canât: Iâm root, and I havenât).
The URL /ojs/login/signIn should map to the script path of /ojs/index.php/index/login/signIn or /ojs/index.php/journalname/login/signIn. That is, a PATH_INFO passes to âindex.phpâ parameters of:
context: âindexâ for the site level, or a journal path for the journal level
page: âloginâ for login/logout operations
operation: âsignInâ for authenticating credentials
Is the sulis subdomain specific to a single journal, or does this represent your OJS site-admin level?
If I add Redirect /ojs/login/signIn http://sulis.ucc.ie/ojs/index.php/index/login/signIn to httpd.conf it then honours a click on the login button, but then it tries to go to http://sulis.ucc.ie/ojs/user which fails.
Is there a list of all the redirects/rewrites I am going to need?
On the sulis subdomain /ojs/ is the site-level admin. Journals will have their own virtual host, eg the working one, http://aigne.ucc.ie/ with the block of rewrites that you composed the last time I got stuck, which seem to be working fine apart from the argument about where âHomeâ should go.
You donât want to maintain a set of rewrites for each page and operation. The general form of the URL will be: protocol :// domain / baseurl / index.php / context / page / operation
You can mask one or both of index.php and context via re-write rules, if desired.
For sulis.ucc.ie to be your site index, and for the URL not to contain the second context reference to âindexâ, youâll want your rewrite rule to say something like:
# For any request which is directed to sulis
RewriteCond %{SERVER_NAME} ^sulis.ucc.ie
# If the request does not already map to a filename
RewriteCond %{REQUEST_FILENAME} !-f
# take anything after /ojs/ and append it as the page and op of the index context for OJS's index.php
RewriteRule ^/ojs/(.)$ /ojs/index.php/index/$1 [QSA,L]
This will require a config.inc.php entry of:
base_url[index] = http://sulis.ucc.ie/ojs
Alternately, if you donât mind seeing the âindexâ context in the URL, the simpler (in my mind) configuration would be:
# For any request which is directed to sulis
RewriteCond %{SERVER_NAME} ^sulis.ucc.ie
# If the request does not already map to a filename
RewriteCond %{REQUEST_FILENAME} !-f
# take anything after /ojs/ and send it to OJS's index.php
RewriteRule ^/ojs/(.)$ /ojs/index.php/$1 [QSA,L]
With a config.inc.php base_url of:
base_url = http://sulis.ucc.ie/ojs
n.b.: all of this is off the top of my head and untested.
This is great, thanks. I wasnât aware of that URI structure before.
The Apache picture is muddied by the fact that OJS isnât the only thing in the top-level /var/www/html â there are dozens of other applications running there, each in its own subdirectory. But examining the RewriteRule it doesnât look as if it will affect them.
So I applied that. The base_url was already there (I did then when installing OJS) along with the entry for the working journal.
So now when I go to http://sulis.ucc.ie/ojs it gives me my OJS Home page already, showing a Log Out link (presumably the login attempt the other day did actually work, even though it couldnât get to the target URI).
You have a discrepancy between your use of dynrev-local.com and dynrev.com, which may just be a transcription issue.
Iâd recommend moving the Rewrite rules into your VirtualHosts. You will then not need the RewriteCond directives for each domain name, and your configuration will be much simpler.