URL rewrite by .htaccess

  • Application Version - OJS 3.1.2-4
  • Description of issue

Hello all.

I don’t have practice in using Mod_rewrite from the Apache server

How can I rewrite the following URL pattern for the new pattern that will be exposed below:

https://ojsinstalation.com/pp/index.php/journal [Old standard]

https://ojsinstalation.com/journal [New standard desired]

It is necessary that if there is a request for the URL of the old standard, it is automatically redirected to the new standard.

Remove the “pp” and “index.php”

Best regards.


Please note that, the version of OJS that you’re using is no longer supported by PKP. I recommend that you upgrade to the newest version of OJS. However, other community members may wish to offer assistance.

Upgrading instructions are available in the PKP Administrator’s Guide.

Information about the latest version of OJS can be found on the [PKP Website]https://pkp.sfu.ca/ojs/

You may also find similar posts on the forum about the issue you are experiencing, such as this one: How to remove index.php in the URL

PKP Team

@rcgillis, we will update to the next version, however, now we are fixing some things before.

I have an installation of OJS that was installed at the root of the html folder. Now that it is at the root, I need to redirect according to requests that arrive for a correct route.

The old URL pointed to https://domain.com.br/pp/index.php/journal

The direct URL of the root and without the “index.php” is https://domain.com.br/journal

I don’t have much practice in creating the .htaccess file

I already removed the “index.php” from the URL with the following rule:

<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond% {REQUEST_FILENAME}! -D
 RewriteCond% {REQUEST_FILENAME}! -F
 RewriteRule ^ (. *) $ Index.php / $ 1 [QSA, L]

Now I need to redirect requests with the old format https://domain.com.br/pp/index.php/journal to https://domain.com.br/journal. We have more than one journal.

Could you help how can I do this?

Hi @andersonvm,

Sorry, I haven’t got much experience with modifying .htaccess files in this fashion. But other community members may wish to weigh in and if you search for “mod_rewrite” on the forum here, you may find other relevant posts.

PKP Team

This topic was automatically closed after 17 days. New replies are no longer allowed.