I ask for the help of OJS community in the correct configuration config.inc.php and .htaccess for one journal for OJS 3.3.0.5. I know that this question has been discussed many times here and before asking this question, I researched a lot of topics dedicated to simplifying links in the OJS installation and I almost succeeded in everything except for two points. I almost certainly made some mistake in .htaccess, but my knowledge is not enough to fix it.
One journal is installed here. I changed the real names to just journalsite and journal. I use the following settings in config.inc.php:
RewriteEngine On
RewriteBase /
# Bugfix for OJS 3.2.0-3: submissions API doesnt work with shortened URLs
RewriteRule ^api/v1(.*)$ index.php/journal/api/v1$1 [L,R=307]
# Rewrite URL to look cleaner
RewriteCond %{SERVER_NAME} ^journalsite
RewriteCond %{REQUEST_URI} !/journal/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/journal/$1 [L]
As a result, all sections in the backsite interface are available except for Administration section. URLs of the remaining sections is like http://journal//submissions, http://journal//manageIssues, and etc. However, the Administration section has a URL http://journal/index/admin and this logically causes the 404 Not Found error. Attempt to access via URL http://journal//admin displays the site interface but with Access denied message.
Note also the double slashes // in the some URLs. I don’t know how to get rid of them. I need help with the right setup:
a) have simplified links in URL; b) have access to the Administration section; c) remove double slashes in URLs
Hi @drugurkocak
I haven’t seen this post, thank you. I tried the “cooking” recipe described there for .htaccess and it remove 2 slashes, but I can’t go to the Administration section anyway. The URL now is http://journal/index/admin but whatever 404 Not Found.
My .htaccess now:
Hi @crosfield
As you may know; after generating the first journal, OJS automatically hides settings and other fields in Administration section, and only “create a new journal link” remains. So, practically there is no need for the Administration section if you have a single journal. If you need to create a new journal, then the scenario becomes totally obsolete.
Regards,
Hi @drugurkocak
Hmm… There are many options left in my Administration section after creating first journal (when restful_urls is disabled):
Site Management
Hosted Journals
Site Settings Administrative Functions
System Information
Expire User Sessions
Clear Data Caches
Clear Template Cache
Clear Scheduled Task Execution Logs
Hi @crosfield
As I explained in my related posts, these solutions are from other users, and I am thankful to them because they shared with me.
As the last sentence,
May I ask, would you need hosted journals link if you will not create a new journal?
Would you need Site settings if no Journal Site will be displayed (since you have single journal)?
None of other links are daily required functions, and might be accomplished by temporarily disabling htaccess directives. We have only one journal on our hands.
But if there are someone that is highly skilled on apache htaccess directives, I would be pleased if shares his/her solution with us.
Regards,
Hi @drugurkocak
Of course you are right and I am also grateful to you for your link, and of course the above options are not a priority for the work of the editorial team, but during debugging of the journal’s theme “Clear Data Caches” and “Clear Template Cache” options are used constantly because of the need to regenerate CSS from LESS etc. In addition, it looks strange to me that a user with admin rights does not have access to the Administrative Section in the main (that is, when the site will be used by the editors) mode of the site and to debug the UI, I will need to temporarily disable the restful_urls, will do my debug work and then enable it again. This will cause all URLs to be temporarily changed and probably only be done at night.
I still hope that there is a solution to my problem, but unfortunately I do not have enough qualifications to solve it on my own
Thanks @mpbraendle for your recipe. I don’t have access to the Apache settings on the server, but that’s not important. Your advice hasn’t worked for me yet, but you’ve given me some ideas. I’ll experiment some more, thanks!
@crosfield, after some days with the same problem, finally I found the solution. The problem was caused because the word “index” at begin of URL link is reserved at Apache when the directive MultiViews is actived on vitualhost.
When I removed this directive, the problem was finally solved.
Changed from:
<Directory /var/www/html/elim/public/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
to
<Directory /var/www/html/elim/public/>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>