Url .htaccess error when installing Wordpress (myjournal.com) and OJS (myjournal.com/journal) on same domain?

I am facing a problem when removing index.php from the OJS urls in OJS 3.1.2.

I want to install my Wordpress on the main domain i.e. www.myjournal.com and then OJS on a subdirectory i.e. www.myjournal.com/journal/.

Wordpress has its own .htaccess file i.e.

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

Now in config.php file of OJS I enabled the restfulurls to be On and placed a new .htaccess file in the www.myjournal.com/journal/ directroy with following code:

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,L]

By this way, the index.php in urls is removed but, the OJS journal website is now showing page not found error and url is rendered by Wordpress site.

Kindly help me to resolve the issue and tell me if my code are correct? How I can disable Wordpress .htaccess to include OJS urls?


Hi @Pankaj_Kumar,

Since Wordpress is intercepting requests that are intended for OJS, you’ll need to adjust the Wordpress rules to make them less invasive. That’s more of a Wordpress (or mod_rewrite) question than an OJS question, so you might have better luck asking on StackOverflow or another similar resource.

Alec Smecher
Public Knowledge Project Team

This is what I am getting in error log:

[23-Sep-2020 01:49:17 UTC] PHP Warning: Creating default object from empty value in /home3/cealp428/public_html/journal/cache/t_compile/00a0a0910209607cb33eb0fe6474f30ed7399ed7^52019e87b90081f2c6bfa717994d81ab7712dd1f_0.app.frontendcomponentssearchF.php on line 30

And page shows too many redirects.