Please, How To Direct Single Journal To Web Root (http://journalpage.com) instead of (http://journalpage.com?index.php/ojs)

Hi @leonardo.mancini

I applied the same configuration on https://journals.adlitip.net and seems to run properly.

I replaced cancer-research.net with journals.adlitip.net

So, the new line has become like;

RewriteCond %{SERVER_NAME} ^(www\.)?journals.adlitip.net

Config
base_url = “https://journals.adlitip.net
base_url[index] = https://journals.adlitip.net/index
base_url[jfm] = https://journals.adlitip.net

You may check it at https://journals.adlitip.net/
for a temporary time.
username: sysmanager
pass: 123456
Regards,

1 Like

Hi @drugurkocak,

At the moment I am stuck, with an error (The server encountered an internal error or misconfiguration and was unable to complete your request; Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request).
I am working around following your guide, which logic I am understanding. I am running on a Linux hosting. What I am not sure yet is first of all the part about “PHP script execution mode : CGI wrapper (run as virtual server owner)”. I am trying to see with my Hosting if I can abilitate this somehow.

Then, I have a question for you about the config.inc.php file. If I search “base_url” inside that file, it will appears the following times:

  1. Line 32, where it says: The canonical URL to the OJS installation (excluding the trailing slash)
    base_url = “https://jta.ista-online.org
  2. Line 79, where I have deleted the ; and where it says: Syntax: base_url[jta] = https://jta.ista-online.org
  3. Lines 83-85:

base_url[index] = https://jta.ista-online.org/index
base_url[jta] = https://jta.ista-online.org
; base_url[myOtherJournal] = http://myOtherJournal.myUrl.com

At line 90 I have: restful_urls = On

Do this configuration looks good for you?
Just to be sure that this is ok and that I have to focus on the .htaccess, which is easier for me to follow on your example.
Thank you very much. and best regards.
Leonardo

ps.: I have adjusted the .htaccess as follows:

# OJS 3.2.1.2 remove journal path

<IfModule mod_rewrite.c>

RewriteEngine On
RewriteBase /

# Bugfix for OJS 3.2.0-3: submissions API doesnt work with shortened URLs

RewriteCond %{SERVER_NAME} ^(www\.)?jta.ista-online.org

RewriteRule ^api/v1(.*)$ index.php/jta/api/v1$1 [L,R=307]

# Rewrite URL to look cleaner
RewriteCond %{SERVER_NAME} ^(www\.)?jta.ista-online.org
RewriteCond %{REQUEST_URI} !/jta/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/jta/$1 [L]


RewriteRule ^api/v1(.*)$ index.php/index/api/v1$1 [L,R=307]


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

</IfModule>

CONFIG.INC.PHP
base_url = "https://jta.ista-online.org"
base_url[index] = https://jta.ista-online.org/index
base_url[jta] = https://jta.ista-online.org
restful_urls = On
 
 htaccess directives for apache virtual host:

 Options +ExecCGI +FollowSymLinks +IncludesNOEXEC -Indexes +SymLinksIfOwnerMatch
  allow from all
 AllowOverride All
 Require all granted

Hi @leonardo.mancini
As a quick look, the .htaccess file should end at;

The remaining lines are related to config.inc.php and httpd.conf file.
Do they exist in .htaccess file? Can you check?
I use Virtualmin panel. If you use Cpanel or Plesk, you may need to find it and change php execution mode to CGI
For ex;
https://docs.cpanel.net/ea4/php/php-handlers/
Regards,

Hi @drugurkocak,

Thank you so much for the quick answer. Sorry, I missed out the closing tag. Now I have added it.

In my previous post I attached also by mistake the lines related to config.inc.php in my model of the .htaccess file, but of course they are not present there.

Now my site is running well: https://jta.ista-online.org

However, it does add the /jta suffix when you start navigating around in the inner pages.
Do you see something else that I should edit?
Thank you very much, really.
Best wishes
Leonardo

P.s. I did enter in your test site, thank you for that.

Hi @drugurkocak,

Edit: SOLVED…!!!
I followed with extreme care your models and guide, and I managed!
I am most thankful to you.
With my best regards,
Leonardo

Hi @leonardo.mancini

It seems that the directives in your htaccess file have no effect. That might be probably due to php execution mode, or AllowOverride settings. For that reason, I shared that directives too.
For ex; when I change php execution mode to FastCGI, I see “No input file specified.” message on a white page. The site doesn’t open at all. So, you should adjust these settings too.

For ex, in virtual host configuration you need to insert such lines; the path might be different in your server. Then, it will probably run well.

<Directory "/home/xxxxx/domains/journals.domain.net/public_html">
Options +ExecCGI +FollowSymLinks +IncludesNOEXEC -Indexes +SymLinksIfOwnerMatch
allow from all
AllowOverride All
Require all granted
</Directory>
    
<Directory /home/xxxxx/domains/journals.domain.net/public/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
</Directory>

Regards,

1 Like

I am glad to heard that it worked. :slight_smile:
Regards,

1 Like

Yes, but also thank you very much for your very last post, which indeed will be for sure useful for future reference.
By the way, I am really most grateful to you: I have learned and I have managed what I wanted to obtain!
This is something that will be for sure very useful for a lot of persons.
With my best wishes,
Leonardo

1 Like

Sorry to resurrect an old thread. This is really useful, but as someone mentioned many posts earlier, it does block access to the admin page which gives a 404 on /index/admin/index

Do you know what I’d need to do to prevent this?

Many thanks

Good day, Have you fixed these bugs, I have the same problem

HI!

We are facing a similar issue with our journal setup. We have installed OJS 3.4.0-4 on nginx. Currently, the page automatically redirects to www.journals.com/journalPath (we have already removed index.php), but we need to remove the /journalPath.
Could anyone share an example or experience on how to achieve this?

Thank you in advance.

Hi @Anda.Abolina,

Hopefully someone using nginx can add a more specific configuration – but in case it helps, there are two parts to a working configuration:

  1. Getting OJS to generate the right URLs. This should be as easy as adding base_url[...] configuration options in your config.inc.php. You can try this without having any special nginx configuration, but until both OJS and nginx are configured, you can expect any subrequests (e.g. AJAX content) to fail, so the page will likely look incomplete. You can view the page source generated by OJS to make sure the URLs look like you want them to.

  2. Getting the web server (e.g. nginx) to route incoming requests to OJS appropriately. This is more of a rewrite rule question than an OJS question, and will depend on what you want and what webserver you’re using, so you might find better information e.g. on StackOverflow. But as you’ve probably already seen, there is an example configuration on this forum that you could use as a starting point.

Regards,
Alec Smecher
Public Knowledge Project Team