Submissions can't be loaded in OMP 3.2.1 using rewrites

Hi,

in OJS 3.1.2 and OMP 1.2 I use rewrites to get rid of “index.php/journal” in the urls. I also use “base_url[journal] = domain.org” in config.inc.php. In OMP 1.2 it works. In OJS 3.1.2 I only get an error for the statistics tool.

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

But after upgrading to OMP 3.2.1., the submissions in the backend can’t be loaded anymore (“An unexpected error has occurred. Please reload the page and try again.”):

PHP Fatal error: Uncaught Error: Call to undefined function import() in /data/omp/domain.org/api/v1/_submissions/index.php:19\nStack trace:\n#0 {main}\n thrown in /data/omp/domain.org/api/v1/_submissions/index.php on line 19, referer: http://domain.org/submissions

I read a number of posts and issues in the forum and on github, but I couldn’t resolve it. Without rewrites, everything works fine (but DOIs can’t be resolved anymore).

regards,
Carola

Hi @carola,

I think the problem is that the !-f rule is being triggered because there is an index.php wrapper script further down the directory tree that is being matched. The request is going to that wrapper directly, rather than the main index.php wrapper, through which all requests must be directed.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

thanks a lot! It was !-d, not !-f.

So far, everything seems to work now.

Regards,
Carola

1 Like